[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 267
  • Last Modified:

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?
0
DiederickH
Asked:
DiederickH
  • 2
1 Solution
 
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
 
moduloCommented:
PAQed with points refunded (250)

modulo
Community Support Moderator
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now