Link to home
Start Free TrialLog in
Avatar of DiederickH
DiederickH

asked on

invoke web service with complex type

I've generated classes for use in visual studio .net (c#), based on a given xsd schema that defines a genericMessage (with the xsd.exe-tool). Now I want to send a message to a web service that accepts this genericMessage-xml. In my main application I create an instance of the genericMessage class and try to send it: WebService.WebMethod(genericMessage-instance)

But the compiler complains that I have given the WebMethod invalid arguments.

And if I use the genericMessage class from the Web Reference to the Web Service and pass it to the web method, the program compiles, but when I test it, I get a missing dependencies error. (the Web Service I try to contact is written in java)

I don't understand why this doesn't work. When I invoke the web method it should create an xml and pass that to the web service right?

Can someone help?
Avatar of sharpnet
sharpnet

Complex types aren't translated into XML equivalents if that's what you're asking.  Is the parameter you're trying to send composed on standard .net types (ie DataSets, XMLDocuments, etc.)?  If you've added the web reference to your project for the web service, you should have some type of ability to instantiate a compatible object.  .NET should be able to do this for you when you add the web reference.

Any more info you can offer?  Or post a URL to the web services wsdl?
Let me rephrase, complex types aren't automatically translated into the object type that the webmethod is asking for...  

Nick
Avatar of DiederickH

ASKER

The problem has been solved. The problem was actually in the java web service. It was still using an older schema version of the genericMessage.
ASKER CERTIFIED SOLUTION
Avatar of modulo
modulo

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial