Im attempting to interact with another company’s web service via WSDL.
I’ve imported it into VS2010 as a service reference, I can make request just fine. The problem is, the return types are strings (of xml). Now I’m fairly new to the WSDL deal, but from what I’ve read there should be return types in the contract and then the service reference would auto-magically generate classes for me.
How do I remedy this?
- I suppose I could map the strings of XML, if so, can someone please
show me a nice example? As I have tried with no avail. - Could I tell the web service to use a return type that I specify?
- Or, do i have the wrong idea about WSDL? And if so, could someone please explain inconsistencies in my understanding?
Your basic idea is correct, having a service wsdl should define the return and input objects to the service operations. The service provider might have a valid reason for just returning you strings or maybe he just didn´t know better.
For you the WSDL is the final frontier, unless your business partner is able to provide a new one you cannot change the service interface, so you have to deal with the XML strings.
Check out XMLDocument, it offers the Load() method accepting a string. If it fails, chances are you´re missing an XSD or you dont have a valid/wellformed xml document contained inside the string. In both cases it´s your business partner who has to correct the error or provide further information.