You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Liu, Scott" <SL...@netsuite.com> on 2004/12/09 22:07:59 UTC

Stub.getHeader in axis 1.1 or 1.2

It looks like both getHeader() and Stub.getResponseHeaders() are
deprecated in axis 1.1. as discussed a little while ago in the attached
message. Does anyone know an alternative way to access soap headers in
an Axis client? I have not tried 1.2 yet and do not know if it works
there.

 

In my application I can set soap headers in .NET and Axis client and I
can get soap headers in .NET but not in my Axis client. Any hints would
be helpful.

 

Thanks,

 

Scott

 

> > -----Original Message-----

> > From: Toshiyuki Kimura [mailto:toshi@apache.org]

> > Sent: Tuesday, October 14, 2003 11:59 PM

> > To: axis-user@ws.apache.org

> > Subject: RE: Stub.getHeader(namespace, partname) in axis1.1

> >

> > Nan,

> >

> >   Umm..., you mean the headers.size() equals to zero.

> >

> >   It seems the difference is from the modification on

> > "org/apache/axis/wsdl/toJava/JavaStubWriter.java".

> >

> > Here is the log;

> > [It may affect Axis 1.1 final]

> > .........*.........*.........*.........*.........*.........*

> > Revision 1.114 / Fri Apr 11 12:21:24 2003 UTC

> > Changes since 1.113: +0 -2 lines

> >

> > deprecated Stub.getResponseHeaders() and removed code for that

> > method so that response headers are not automatically reflected

> > back into the global header list for the Stub.  The method will

> > remain in the code because pre-1.1 stubs will reference the

> > method. Updated the stub writer to not generate files referencing

> > getResponseHeaders().

> > .........*.........*.........*.........*.........*.........*

> >

> > [It may affect the nightly build (i.e. the current code)]

> > .........*.........*.........*.........*.........*.........*

> > Revision 1.31 / Thu Aug 7 20:38:22 2003 UTC

> > Changes since 1.30: +39 -1 lines

> >

> > Add back in the ability to get response SOAP headers via the Stub.

> > Add a test case to make sure it works.

> >

> > This was removed in April 2003 to fix the problem where response

> > headers would be placed in the same place as request headers.

> > The solution to that went (way) too far, and in Axis 1.1, you can

> > only get response headers if you have the Call object, which you

> > can get from the Service object, which you *can't* get from the

> > Stub object.

> >

> > Solution is to add 2 new Stub APIs:

> >     public SOAPHeaderElement[] getResponseHeaders()

> >     public SOAPHeaderElement getResponseHeader

> >                               (String namespace, String partName)

> >

> > This makes it explicit that the response headers are separate from

> > the request headers.

> > .........*.........*.........*.........*.........*.........*

> >

> >   You'd better use the latest code, if you want to touch

> > the headers from your stub  -  apologies for the detour.

> >

> > --

> > Toshi <to...@apache.org>