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 "Meeusen, Christopher W." <Me...@mayo.edu> on 2011/02/14 18:14:43 UTC

ADB Client Access Returned Soap Env?

Hi,

 

I have an ADB client that is working fine, but I would like to get the
contents of the soap envelope and store that XML/String somewhere for
comparisons later in my app.  I'm able to do a round trip to the server
and my stub is populated fine with all the elements, but how do I access
the returned envelope itself?

 

I've been looking through the docs here but I don't see a method to
retrieve this.
http://axis.apache.org/axis2/java/core/api/org/apache/axis2/client/Stub.
html

 

 

 

Thanks,

Chris


AW: ADB Client Access Returned Soap Env?

Posted by Stadelmann Josef <jo...@axa-winterthur.ch>.
Hi Chris,

 

Just to clarify: do you want to have access to the envelope or one of
the two items referenced by the envelope which is the soap-header-part
or the soap-body-part?

You get back a response and that is what you can refer to as the
applications payload. That is the content of an envelope, the soap-body.
Why would you need to have access (as you write it) to the envelope as
the outer most part in a sopa/xml message? The envelope has a
soap-header (like any envelope should have) and a soap-body part.
Application requests from a client and responses from a server are
shipped in the soap-body. While Infrastructure items like soap-headers
are sent by client and server in the header-part and are handled by the
infrastructure of axis2 (client and server) through modules and other
axis2 engine related layers.

 

If you want to access the message-soap-body-part, then .-1 is the way to
go. And the Axiom OMElement omElt as .-1 said can be traversed by nodes
from parent to child and from sibling to sibling through Axiom routines.

 

Josef

 

 

 

Von: Meeusen, Christopher W. [mailto:Meeusen.Christopher@mayo.edu] 
Gesendet: Montag, 14. Februar 2011 18:15
An: axis-user@ws.apache.org
Betreff: ADB Client Access Returned Soap Env?

 

Hi,

 

I have an ADB client that is working fine, but I would like to get the
contents of the soap envelope and store that XML/String somewhere for
comparisons later in my app.  I'm able to do a round trip to the server
and my stub is populated fine with all the elements, but how do I access
the returned envelope itself?

 

I've been looking through the docs here but I don't see a method to
retrieve this.
http://axis.apache.org/axis2/java/core/api/org/apache/axis2/client/Stub.
html

 

 

 

Thanks,

Chris


Re: ADB Client Access Returned Soap Env?

Posted by Gerard Draper <dr...@gmail.com>.
Hi,

Try this (you can use it with your requests too):

<YourClass>  response = stub.SomeOperation(request);
OMElement   omElt = response.getOMElement(response.MY_QNAME,
OMAbstractFactory.getSOAP12Factory());
String            xml = omElt.toStringWithConsume();

I use it when I want to check if the content (Body) of the SOAP messages is
build correctly.


On Mon, Feb 14, 2011 at 6:14 PM, Meeusen, Christopher W. <
Meeusen.Christopher@mayo.edu> wrote:

> Hi,
>
>
>
> I have an ADB client that is working fine, but I would like to get the
> contents of the soap envelope and store that XML/String somewhere for
> comparisons later in my app.  I’m able to do a round trip to the server and
> my stub is populated fine with all the elements, but how do I access the
> returned envelope itself?
>
>
>
> I’ve been looking through the docs here but I don’t see a method to
> retrieve this.
> http://axis.apache.org/axis2/java/core/api/org/apache/axis2/client/Stub.html
>
>
>
>
>
>
>
> Thanks,
>
> Chris
>



-- 
Gerard Draper Gil