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?
DiederickHAsked:
Who is Participating?
 
moduloConnect With a Mentor Commented:
PAQed with points refunded (250)

modulo
Community Support Moderator
0
 
sharpnetCommented:
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?
0
 
sharpnetCommented:
Let me rephrase, complex types aren't automatically translated into the object type that the webmethod is asking for...  

Nick
0
 
DiederickHAuthor Commented:
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.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.