I don't know if that would be possible, but I don't see why WSDL2Java can't anticipate what I want to do with the XML if a .NET client can figure it out it should be possible for WSDL2Java as well, unless MS uses very non-standard methods of course (but even then an option --lenient-wsdl-parsing would be nice ;-)
Anyway, I finally figured out a way to get half-way to what I want. If I have a method on the server like this: org.w3c.dom.Document getSomeComplexInfo(); I now generate the code using WSDL2Java, throw away all the beans it generated, replace all references to the beans with org.w3c.dom.Element and make a (De)Serializer type mapping for the Element(De)Serializer in the SoapStub's constructor. I then change the stub code so all methods that before used the bean (de)serializers now use the element (de)serializer. In the end the method above changes to: org.w3c.dom.Element getSomeComplexInfo(); Which is close enough (for now). But it would be nice if WSDL2Java could handle this all by itself, wouldn't it? Cheers, -Tako > -----Original Message----- > From: Thomas Mikalsen [mailto:[EMAIL PROTECTED]] > Sent: dinsdag 30 april 2002 17:31 > To: [EMAIL PROTECTED] > Subject: RE: How to retrieve an XML document from a service? > > > > If this is the case (i.e., WSDL2Java cannot anticipate > anything), then it > would be nice to be able to tell WSDL2Java what you want it to do. > In particular, the ability to specify per-part mappings. > E.g., that the > input parts should be mapped to java types, while the return > part(s) should > be treated as raw XML. > Is there anything in WSDL that WSDL2Java could use as a hint > for this? How > does it interpret the soap:body "use" attribute? > > thanks, > -tom > > > > > |---------+------------------------------> > | | "St-Germain, | > | | Sylvain" | > | | <Sylvain.StGermain@| > | | cognos.com> | > | | | > | | 04/30/2002 11:10 AM| > | | Please respond to | > | | axis-user | > | | | > |---------+------------------------------> > > >------------------------------------------------------------- > -----------------------------------------------| > | > | > | To: [EMAIL PROTECTED] > | > | cc: > | > | Subject: RE: How to retrieve an XML document from > a service? | > | > | > | > | > > >------------------------------------------------------------- > -----------------------------------------------| > > > > > You are right WSDL2Java cannot anticipate anything! Thanks > for the code > chunk. > Sylvain. > > -----Original Message----- > From: Andrew Vardeman [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, April 30, 2002 10:49 AM > To: [EMAIL PROTECTED] > Subject: RE: How to retrieve an XML document from a service? > > > I think the problem is that WSDL2Java can't anticipate how > you're planning > to use the XML that's returned. Anyway, it's easy enough to > get the entire > > body of a SOAP message returned by some service. Attached is > an example > client that does this. Instantiate the service with a String > that holds > the XML of the message you want to send to the service; then run > makeCall(). It returns a String representation of the SOAP > body returned. > > Andrew > > At 04:17 PM 4/30/2002 +0200, you wrote: > > >So what you are suggesting is to forget about all the beans and just > >extract the XML from the SOAP envelope? > > > >But wouldn't it be better if WSDL2Java would generate this > code? It seems > >simple enough. > >Or is the .NET way not standard enough to it that way? > > > >-Tako > > > > > > > -----Original Message----- > > > From: St-Germain, Sylvain [mailto:[EMAIL PROTECTED]] > > > Sent: dinsdag 30 april 2002 16:06 > > > To: [EMAIL PROTECTED] > > > Subject: RE: How to retrieve an XML document from a service? > > > > > > > > > > > > After you made your call you can get to the SOAP envelope using: > > > > > > service.getCall().getResponseMessage().getSOAPPart() > > > > > > Sylvain. > > > > > > -----Original Message----- > > > From: Tako Schotanus [mailto:[EMAIL PROTECTED]] > > > Sent: Tuesday, April 30, 2002 5:20 AM > > > To: [EMAIL PROTECTED] > > > Subject: How to retrieve an XML document from a service? > > > > > > > > > I used WSDL2Java to generate some code for a .NET web service > > > that returns > > > an XML document as a result. > > > After inspecting the code I noticed that all XML document > > > results had been > > > converted to Beans. > > > > > > Can somebody point me in the direction I should go to get > > > from a Bean to the > > > original XML document? > > > Is this bean stuff even necessary or is it just the code > > > generator that > > > doesn't know how to handle .NET XML document types and turns > > > everything > > > unknown into beans? > > > > > > I did find the info about the ElementDeserializer, but > > > couldn't figure out > > > how to use them. > > > > > > Any help would be much appreciated :-) > > > > > > -Tako > > > > > > > > > Tako Schotanus > > > Chief Software Architect > > > > > > -------------------------------------------------------- > > > BackStream® Content Management > > > > > > Postbus 58385 > > > 1040 HJ Amsterdam > > > > > > Willem de Zwijgerlaan 350 > > > 1055 RD Amsterdam > > > > > > The Netherlands > > > > > > tel. +31 (0)20 6827332 / fax +31 (0)20 6827632 > > > > > > http://www.backstream.com > > > -------------------------------------------------------- > > > > > > This message may contain privileged and/or confidential > > > information. If you > > > have received this e-mail in error or are not the intended > > > recipient, you > > > may not use, copy, disseminate or distribute it; do not open any > > > attachments, delete it immediately from your system and > > > notify the sender > > > promptly by e-mail that you have done so. Thank you. > > > > > This message may contain privileged and/or confidential > information. If > you > have received this e-mail in error or are not the intended > recipient, you > may not use, copy, disseminate or distribute it; do not open any > attachments, delete it immediately from your system and > notify the sender > promptly by e-mail that you have done so. Thank you. > > > > > >