Search code examples
c#.netwcfxml-serializationmessagecontract

How can I generate a custom SOAP message


I have a site that give me this xml response on my GET request:

<ServerUnits>
    <State Name="ServerName" Date="2008-04-01" >
    <Users>
       <User login="someUser1" Password="123456">
       <User login="someUser2" Password="qwerty">
    </Users>
</ServerUnits>

I want use WCF Client for work with this service. How to discraibe Message Contract of this response for WCF Clien


Solution

  • It is best to create client proxies for the WCF service. It will create the data contracts for you (as mentioned by @Aliostad) so you don't have to create them manually. To do this right click on your solution and select "Add Service Reference..." from the context-menu and enter the address to your WCF service.