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 <[EMAIL PROTECTED]>

-----Original Message-----
From: Nan Xiong [mailto:[EMAIL PROTECTED]
Sent: Wednesday, October 15, 2003 1:35 PM
To: [EMAIL PROTECTED]
Subject: RE: Stub.getHeader(namespace, partname) in axis1.1

Toshi,

I dont think the problem is the namespace, since stub.getHeaders()
returns 0 size array in axis1.1... so basically somehow, the headers
are not in stub anymore in axis1.1.
do you have more pointers where problem may be?

thanks
Nan

> -----Original Message-----
> From: Toshiyuki Kimura [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, October 14, 2003 8:36 PM
> To: [EMAIL PROTECTED]
> Subject: RE: Stub.getHeader(namespace, partname) in axis1.1
>
> Nan,
>
>   Thank you for sending the response message.
> I think this is not an intentional behavior. The stub.getHeader()
> has never changed between 1.1 RC2 and 1.1 final, and the code is
> as follows;
>
>  public SOAPHeaderElement getHeader(String namespace,String partName){
>    for(int i=0;i<headers.size();i++) {
>      SOAPHeaderElement header = (SOAPHeaderElement)headers.get(i);
>      if(header.getNamespaceURI().equals(namespace) &&
>           header.getName().equals(partName))
>           return header;
>    }
>    return null;
>  }
>
>   Please pay attention to the code -
>                 "header.getNamespaceURI().equals(namespace)".
>
>   If the value of header.getNamespaceURI() doesn't equal to
> the namespace what you passed, you should get 'null'.
> That's a namespace issue, as I guessed.
>   You're lucky.  You have a chance to submit a patch, if you
> can debug the code.  Please. :-)
>
> --
> Toshi <[EMAIL PROTECTED]>
>
> -----Original Message-----
> From: Nan Xiong [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, October 15, 2003 11:12 AM
> To: [EMAIL PROTECTED]
> Subject: RE: Stub.getHeader(namespace, partname) in axis1.1
>
> Toshi,
>
> Thanks for your reply. I'm usng .NET 1.1 (2003).
> the soap response from .NET is:
>
> <?xml version="1.0" encoding="utf-8"?>
> <soap:Envelope
>  xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";
>  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>  xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
>   <soap:Header>
>    <SessionTokenHeader
>      xmlns="http://www.viewstar.com/webservices/2002/11";>
>     <Token>
>      VE9WXV5HS0zigKZd4oChX05hXMWSXmVswpBWWkbigJ1JSUxMTU9TUV
>      NSWFdFWlhiYmNlXV/CqmBlwq1kY2NoamZpaWp0XG5weXXCunx3wqnD
>      geKEosuGwrvCvcKzwrhsw4DCssK8wrHCv8K7w4XDiMOHw4rDhg==
>     </Token>
>    </SessionTokenHeader>
>   </soap:Header>
>  <soap:Body>
>   <LoginResponse
>    xmlns="http://www.viewstar.com/webservices/2002/11";>
>     <LoginResult>true</LoginResult>
>   </LoginResponse>
>  </soap:Body>
> </soap:Envelope>
>
> I'm accessing header from Stub as following:
>
> stub.getHeader("http://www.viewstar.com/webservices/2002/11";,
>                "SessionTokenHeader");
>
> the above call returns null in axis1.1, but returns correctly in axis
> 1.1 RC2, against the same .NET service.
>
> I'm able to work around it using client side handler, but I would like
> to know whether this is intentionally disabled?  Will the soap handler
> be a perfered way in terms of compliance to jaxrpc spec.
>
> Thanks
> Nan
>
> > -----Original Message-----
> > From: Toshiyuki Kimura [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, October 14, 2003 6:49 PM
> > To: [EMAIL PROTECTED]
> > Subject: Re: Stub.getHeader(namespace, partname) in axis1.1
> >
> > Nan,
> >
> >   I guess that it might be related to a change of handling
> > for namespace between RC2 and 1.1 final.  A couple of days
> > before, I've met an interop issue - using Axis 1.1 final as
> > the server and .Net(InfoPath 2003) as the client.
> >
> >   Did you snoop the messages ? What's the version of .Net ?
> >   Could you post your request/response messages and its WSDL
> > files for both using 1.1 RC2 and 1.1 final ?
> >
> > --
> > Toshi <[EMAIL PROTECTED]>
> >
> > -----Original Message-----
> > From: Nan Xiong [mailto:[EMAIL PROTECTED]
> > Sent: Wednesday, October 15, 2003 5:46 AM
> > To: [EMAIL PROTECTED]
> > Subject: Stub.getHeader(namespace, partname) in axis1.1
> >
> > Hello,
> >
> > I have a .NET web services that passes session id (a string)
> > in the soap header, we were able to use Stub.getHeader(...)
> > and Stub.setHeader() to make axis client talking to the .NET
> > services using axis1.1 RC2, however, in axis1.1 final release,
> > getHeader returns null.  Anybody has the same problem?
> > Can someone confirm this is a bug?  or intentionally disabled?
> > Whats the alternatives to access the header? (client handler?)
> >
> > Thanks in advance
> > Nan
>

Reply via email to