WCF: Add Service reference creates message contract RRS feed

  • Question

  • Proxy generated for WCF service creates Message contracts if I have the datatable/dataset data member though "Always generate message contracts" option unchecked. How can I force Data contract instead of Message Contract.
    Thursday, February 20, 2014 9:24 PM


  • Hi,

    From your description, I know that even you have unchecked the "Always generate message contracts" option, but it still created the message contracts for your service.

    I want to know that have you tried deleting the service reference and adding it again? If that doesn't help, try generating the proxy using svcutil.exe and see what you get. If you are getting what you would expect (data contract) from svcutil.exe then this is most likely caused by some settings in Add Service Reference.

    And some people meet this question when the object used in the service that hadn't been marked as a [DataContract]. Please try to check it. 

    Best Regards,
    Amy Peng

    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, February 24, 2014 6:02 AM