I'm calling someone else's web service, they have provided a WSDL file and a bunch of XSD files. I have create the web reference in my project using the local WSDL file and created a class using xsd.exe. The web method I'm calling is
object MyService.MyMethod(object myObj)
So I create a new instance of my service and a new instance of my object created by the xsd. The web service documentation tells me that myObj is of type ObjectRQ (created from the xsd).
My code is like this:
MyService service = new MyService();
ObjectRQ request = new ObjectRQ();
// Set the values of request.
object result = service.MyMethod(request);
On the last line of that code I get an error:
The type ObjectRQ was not expected. Use the XmlInclude or SoapInclude attribute to specify types that are not known statically.
I don't know what could be causing this error and my search hasn't yielded anything helpful. Can anyone help me with this?