You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Paul Mahoney <pt...@xact.co.uk> on 2007/04/04 09:32:02 UTC

RE: AXIS style (MessageElement[] <-> String of xml)

Here's the stub I calling:

 public com.galileo.webservices.SubmitXmlResponseSubmitXmlResult
        submitXml(java.lang.String profile,
                  com.galileo.webservices.SubmitXmlRequest request,
                  com.galileo.webservices.SubmitXmlFilter filter
        )throws java.rmi.RemoteException { ... }

The constructor for the SubmitXmlRequest and SubmitXmlFilter classes take
(MessageElement[] _any) as it's argument. 

I have a string of XML ... <stuff>...</stuff>. So my problem is how to
convert my xml String into an array of MessageElement's.

Ideally I want to avoid this altogether and have stubs that take and return
String's of XML, but it looks like AXIS/WSDL2JAVA is forcing me to convert
String's to object which it will serialise again... Seems a waste :-(

So it would be grate if you can tell me how to generate the MessageElement
array. It would be brillient if you could tell me how to avoid all this xml
String's <-> object serialisation/deserialisation that I don't really want
:-)

>-----Original Message-----
>From: Anne Thomas Manes [mailto:atmanes@gmail.com] 
>Sent: 03 April 2007 22:01
>To: axis-user@ws.apache.org; ptm@xact.co.uk
>Subject: Re: AXIS style
>
>I'm not sure where you got the idea that document style will map the
>message to DOM-- unless your coding at the raw XML level -- but then
>you wouldn't be using a stub.
>
>Document style will map the message to a Java object. If you define
>the message in the WSDL as an opaque xs:string, then Axis will map it
>to a String. (Be careful with this though -- the encoding/decoding
>process is not especially robust.) If the WSDL describes the schema of
>the message, then the stub should map the message to a corresponding
>object (typically a bean).
>
>The only reason why Axis would map it to DOM is if you configure Axis
>to use the "Message" style. (That would be defined in your
>client-config.xml.)
>
>If you're using Axis2, then it maps the message to AXIOM (the Axis2
>StAX-based object model) rather than DOM, although you can also use a
>databinding framework to map it from AXIOM to a Java object.
>
>Perhaps you can show us a little more of what you're doing? Keep in
>mind that the normal use case for both Axis and Axis2 is to map the
>XML to a Java object model.
>
>Anne
>
>
>On 4/3/07, Paul Mahoney <pt...@xact.co.uk> wrote:
>> Sorry, I was unclear. I have a String containing my xml. 
>With the document
>> style I need to parse it into a DOM node tree and pass it to 
>the stub. The
>> response is also a DOM node tree I'll need to convert to a 
>String. I want
>> AXIS to step back, and just take my XML String and return an String
>> containing XML. But wsdl2jave is putting in place layers of 
>code to consume
>> and generate DOM node object trees. As far as I can see, 
>wsdl2java is doing
>> this because the WSDL file say style="document". The service 
>may want to use
>> DOM node trees, but why should I?
>>
>> >-----Original Message-----
>> >From: Philipp Leitner [mailto:philipp.leitner@gmx.at]
>> >Sent: 03 April 2007 20:36
>> >To: axis-user@ws.apache.org
>> >Subject: Re: AXIS style
>> >
>> >what do you mean with "turn my xml into DOM" ? The Document
>> >Object Model
>> >(if this the meaning of DOM that you are referring to, since
>> >there are a
>> >few different ones) is just one possibility to represent XML,
>> >and afaik
>> >not one used by Axis. I guess what you mean with "DOM" is
>> >actually Axiom.
>> >
>> >If that's what you meant ... no, I don't think there's any 
>way to make
>> >Axis2 not use Axiom.
>> >
>> >/philipp
>> >
>> >Paul Mahoney schrieb:
>> >> I have used wsdl2java to generate stubs for a web service
>> >that specifies
>> >> document style. Consequently the stubs want me to turn my
>> >xml into DOM and I
>> >> need to turn the returned DOM back to XML :-(
>> >>
>> >> Is there anyway I can tell wsdl2javs to use message style as
>> >I want to work
>> >> with xml not DOM? Is does seem strange that the web service
>> >appears to be
>> >> dictating the client use DOM.
>> >>
>> >>
>> >> 
>---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>> >> For additional commands, e-mail: axis-user-help@ws.apache.org
>> >
>> 
>>---------------------------------------------------------------------
>> >To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>> >For additional commands, e-mail: axis-user-help@ws.apache.org
>> >
>> >
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>> For additional commands, e-mail: axis-user-help@ws.apache.org
>>
>>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org