Reputation: 4560
I am learning WCF and using the messaging protocol SOAP (HTTP and XML).
I understand that this a a XML based protocol. The thing I am seeing across guides is that you need to send a XML Soap Envelope to make a request so the service can respond with XML back. However, when I set the client side up to use the service, I don't pass any XML in at all and the response I get is a string.
Dim client As webservice.Service1Client = New webservice.Service1Client()
' I was expecting this to be XML and I would need to parse it...
' In the service side I do say "Return string" - but should I be stating "Return type of XML"?
Dim response As String = client.serviceMethod("test")
This all works but I am just wondering if this is the correct procedure? I am bit worried that I am not creating XML and the service isnt return an Envelope of XML.
Thanks
Upvotes: 0
Views: 180
Reputation: 31750
I was expecting this to be XML and I would need to parse it
If you call your service using something like fiddler or SoapUI you will be able to see the SOAP XML request and response messages in their raw form.
When you consume a SOAP service in WCF however, you are abstracted away from this bare message interchange by the framework.
You don't need to think about XML anymore, you only need to think in terms of request/response semantics and the data types returned (in your case, a System.String) by the service operation you are calling.
WCF is still conducting a complex conversation based on the exchange of a series of SOAP messages, you just don't need to see any of that.
Upvotes: 2