Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

WSDL stub generation question

Jim Janssens
Ranch Hand
Posts: 210
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a document/literal WSDL file which refers to complex types (that are included in the WSDL itself), for the input and output parameters of the service. So my java stub (generated with WSDL2Java) looks like:

Further more, the default serializer handles the XML creation for me (thanks to the auto generated mappings). This means that I supply the "InputType" object to my stub, and the serializer creates the XML. Next axis puts this XML into a soap body and sends it.

Thats nice !

However, I allready _have_ the XML that corresponds to the object InputType. So I'm not going to parse it to objects and then let the serializer parse it back to XML. I'm looking for a way so I can feed the XML directly to my stub, bypassing the serialization mechanism.

What I would like to know is, which is the "best practise" thing to do ?

For example, I could modify the generated "InputType" class so that it takes an XML string and let the serialize method return that XML string.

Is this the way to go ? are there other alternatives ?

Note: another alternative may be changing the WSDL and having an xs:anyType or String as input parameter. This way I can pass a DOM node or the XML string itself. But I cannot change the WSDL, so thats not an option.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic