Tutorial :WCF, LINQ, Silverlight Problem



Question:

I am starting to learn silverlight, WCF and LINQ here. the silverlight is hosted in the asp.net website. in the asp.net website, 1. added LINQ to SQL Classes with one table "ABC". 2. added WCF Service with one method "RetrieveABC" to retrieve "ABC" table from database. 3. in Silverlight Added WCF Service and successfully run RetrieveABC method.

the problem arise when I added second table to the the LINQ to SQL Classes (*.dmbl) let say "XYZ". Everything generated nicely, XYZ appear in the Service. nothing changed.

but when I tried to run the silverlight application again to run "RetrieveABC", it came back with error: "The server did not provide a meaningful reply; this might be caused by a contract mismatch, a premature session shutdown or an internal server error."

Any idea about this?

thanks bonbon.


Solution:1

It sounds like you need to update the WCF Service reference.

When you add a WCF Service reference, some code is generated on the client side. You then updated the classes on the server side by adding the new table. At this point the code on the server side does not match the generated code on the client side.


Solution:2

Fixed by changing the Serialization Mode in DataContext to "UniDirectional"


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »