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 Gregor Urbanek <gr...@menticorp.ch> on 2005/09/27 10:54:09 UTC

[AXIS2] Soap Headers Handling

Hi  everyone ,

in Axis1, working with a wsdl2java generated stub, I could set a Soap 
header as follow

...
  wsdl2JavaGeneratedStubObject.setHeader( "serviceNameLocalPart", 
"headerName",  headerObject );
...

Afaik, it appears that the Axis2 generated Stubs does not have the 
appropriate setHeader method. Is there a workaround for this?


Cheers
Gregor


Re: [AXIS2] Soap Headers Handling

Posted by Gregor Urbanek <gr...@menticorp.ch>.
Ajiht, thanks for the pointers. With this knowledge, it will be easy to 
augment the axis2 generated stub with the necessary setHeader method.

Anne, the option to move the headers to the body is not feasible for a 
third party wsdl. There are different headers there. Esp. for the 
headers dealing with session management, I might consider writing a 
handler for.

Anne Thomas Manes wrote:

> It's more appropriate to manipulate headers using a handler.
> If your application needs access to the information in the Header, you 
> should consider moving that information to the Body.
>
> Anne
>
> On 9/27/05, *Ajith Ranabahu* <ajith.ranabahu@gmail.com 
> <ma...@gmail.com>> wrote:
>
>     Hi Gregor,
>     Well the stubs do not expose any method to work with the headers.
>     But the  Axis2 stubs have direct access to the envelope. So you
>     can set the headers directly in the envelpe if you want. Moreover
>     the stub base class has some utility methods to set arbitrary
>     headers to the envelope.
>     So unfortunaltely(?) you'll have to modify the stub if you are in
>     need of adding a custom header !
>
>
>     On 9/27/05, * Gregor Urbanek* < gregor.urbanek@menticorp.ch
>     <ma...@menticorp.ch>> wrote:
>
>         Hi  everyone ,
>
>         in Axis1, working with a wsdl2java generated stub, I could set
>         a Soap
>         header as follow
>
>         ...
>           wsdl2JavaGeneratedStubObject.setHeader( "serviceNameLocalPart",
>         "headerName",  headerObject );
>         ...
>
>         Afaik, it appears that the Axis2 generated Stubs does not have
>         the
>         appropriate setHeader method. Is there a workaround for this?
>
>
>         Cheers
>         Gregor
>
>
>
>
>     -- 
>     Ajith Ranabahu 
>
>

Re: [AXIS2] Soap Headers Handling

Posted by Anne Thomas Manes <at...@gmail.com>.
It's more appropriate to manipulate headers using a handler.
If your application needs access to the information in the Header, you
should consider moving that information to the Body.

Anne

On 9/27/05, Ajith Ranabahu <aj...@gmail.com> wrote:
>
> Hi Gregor,
> Well the stubs do not expose any method to work with the headers. But the
> Axis2 stubs have direct access to the envelope. So you can set the headers
> directly in the envelpe if you want. Moreover the stub base class has some
> utility methods to set arbitrary headers to the envelope.
> So unfortunaltely(?) you'll have to modify the stub if you are in need of
> adding a custom header !
>
> On 9/27/05, Gregor Urbanek < gregor.urbanek@menticorp.ch> wrote:
> >
> > Hi everyone ,
> >
> > in Axis1, working with a wsdl2java generated stub, I could set a Soap
> > header as follow
> >
> > ...
> > wsdl2JavaGeneratedStubObject.setHeader( "serviceNameLocalPart",
> > "headerName", headerObject );
> > ...
> >
> > Afaik, it appears that the Axis2 generated Stubs does not have the
> > appropriate setHeader method. Is there a workaround for this?
> >
> >
> > Cheers
> > Gregor
> >
> >
>
>
> --
> Ajith Ranabahu

Re: [AXIS2] Soap Headers Handling

Posted by Ajith Ranabahu <aj...@gmail.com>.
Hi Gregor,
Well the stubs do not expose any method to work with the headers. But the
Axis2 stubs have direct access to the envelope. So you can set the headers
directly in the envelpe if you want. Moreover the stub base class has some
utility methods to set arbitrary headers to the envelope.
So unfortunaltely(?) you'll have to modify the stub if you are in need of
adding a custom header !

On 9/27/05, Gregor Urbanek <gr...@menticorp.ch> wrote:
>
> Hi everyone ,
>
> in Axis1, working with a wsdl2java generated stub, I could set a Soap
> header as follow
>
> ...
> wsdl2JavaGeneratedStubObject.setHeader( "serviceNameLocalPart",
> "headerName", headerObject );
> ...
>
> Afaik, it appears that the Axis2 generated Stubs does not have the
> appropriate setHeader method. Is there a workaround for this?
>
>
> Cheers
> Gregor
>
>


--
Ajith Ranabahu