none
Samples: WCF + Entity Framework

    Question

  • Please post any links for samples of WCF integration with EDM.

    I am struggling with publishing EDM objects as return type of WCF Operation Contract.

    I generate the proxy using svcutil.exe

    Appreciate all the help.

    Thanks

    Tuesday, August 19, 2008 2:44 PM

All replies

  • You may want to check out the code here:

     

    http://code.msdn.microsoft.com/entitybag/

     

    While not updated for the official release of .NET Framework 3.5 SP1 yet, it shows how to use DataContract serialization with the Entity Framework pretty extensively. There is also a "testing out the entity bag" article here:

     

    http://www.thedatafarm.com/blog/2008/01/25/CreatingAndConsumingAWCFServiceToTestTheEntityBagClass.aspx

     

    What sorts of problems are you running into?

     

    Jeff

     

    Tuesday, August 19, 2008 3:07 PM
  • Hi,

     

    I also posted the issue here:

    http://forums.microsoft.com/Forums/ShowPost.aspx?PostID=2028336&SiteID=1

     

    Let me summerize.

     

    1. I have EDM and an entity pointing to 2 tables

    2. I am not using Data Services but WFC custom interface/Contract receiving and returning the above entity

    3. The WCF service is all set and I test run it using a simple call returning an integer - It works

    4. Now, when I call the interface returning the IEnumerable<Above Entity>, it shows the following error

     

    "An error occurred while receiving the HTTP response to http://localhost:8123/TradeXModel. This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). See server logs for more details."

     

    Thanks

     

     

     

    Tuesday, August 19, 2008 4:15 PM
  • Hi,

    I was able to narrow it down to the problem of returning IEnumrable<T> from a WCF call.

    I am yet to find a good solution except working it out with and array of T.

    I also looked at the EntityBag but would like to see a built-in solution.

    Please post any other solution.

    Thanks
    Wednesday, August 20, 2008 6:31 PM
  • The IEnumrable problem has been logged here

    https://connect.microsoft.com/wcf/feedback/ViewFeedBack.aspx?FeedbackID=336696

    Can anyone confirm if it is still an issue and when there will be a solution for this?

    Wednesday, August 20, 2008 6:34 PM
  • I would really like to know if the problem described in the link below has been resolved,

    https://connect.microsoft.com/wcf/feedback/ViewFeedBack.aspx?FeedbackID=336696

    EntityBag is another level of abstraction that I would like to avoid. Is it going to be included in the Entity Framework release?

    In the above link
    SinclairSchuller and Lary_c has posted the exact points that I am facing today with SP1 installed !

    I am running all this on WIN XP SP2 box.

    Please help.
    Tuesday, September 09, 2008 12:57 PM