No, there's nothing sacred about generated code.ideally you're only supposed
to implement the Skeleton class, but if you need to do things with the SOAP
message itself, you'll have to do it in the Stub.

 

  _____  

From: hoy hoy [mailto:[EMAIL PROTECTED] 
Sent: Friday, December 01, 2006 5:04 PM
To: axis-user@ws.apache.org; [EMAIL PROTECTED]
Subject: Re: how to get soap header from stub in axis2

 

Yes I saw that in the generated Stub.  But is there a way to extract the
SOAP header without modifying the generated stub?  

My understanding was the stubs are not supposed to be modified?  I was
hoping to extract the header by using the generated stub methods.  I suppose
this will only be exposed if the soap-headers are explicitly declared in the
WSDL (which they are not in my case). 

-Hoy



On 12/1/06, Brennan Spies <[EMAIL PROTECTED]> wrote:

Assuming you are talking about the return envelope (from the service), you
should see something like

 

                  org.apache.axis2.context.MessageContext
_returnMessageContext = _operationClient

 
.getMessageContext(org.apache.axis2.wsdl.WSDLConstants.
MESSAGE_LABEL_IN_VALUE); 

                  org.apache.axiom.soap.SOAPEnvelope _returnEnv =
_returnMessageContext

                              .getEnvelope(); 

 

In your stub's invocation method. You can use a _returnEnv.getHeader() call
to access the header.

 

  _____  

From: hoy hoy [mailto:[EMAIL PROTECTED] 
Sent: Friday, December 01, 2006 2:40 PM
To: axis-user@ws.apache.org; [EMAIL PROTECTED]
Subject: Re: how to get soap header from stub in axis2

 

I know how to add headers, via:

stub._getServiceClient().addStringHeader(...)

however, after the call is made;

stub.MyMethodToInvoke(...)

I want to view the soap headers that are returned.  Using ethereal (network
sniffer) I can see the headers, but they are not exposed on the stub class.
There are no, stub.getHeader(...) methods that I can use, unless I need to
do something fancier?

How do I get the SOAPEnvelope from a Stub?  Eseentially, the stub is all I'm
working with or do I need to look elsewhere?

Thanks so much for your help Brennan! 

Hoy

On 11/30/06, Brennan Spies <[EMAIL PROTECTED]> wrote:

The SOAPEnvelope (which you create on the client or receive from the
service) has a getHeader() method for getting the SOAPHeader axiom class
that has the appropriate methods. The ServiceClient (class member in the
Stub) also has helper methods for adding SOAP headers.

 

  _____  

From: hoy hoy [mailto: [EMAIL PROTECTED] 
Sent: Thursday, November 30, 2006 1:55 PM
To: axis-user@ws.apache.org
Subject: how to get soap header from stub in axis2

 

Hi all,

I'm using Axis 2 1.1 and have a stub that was generated from a WSDL.  The
soap call that I'm making returns SOAP headers, namely session information.
How can I retrieve those SOAP headers from my stub?  What methods or helper
classes do I need to use? 

Thanks,
Hoy

 

 

Reply via email to