I am trying to understand how SOAP headers are handled by Axis.
I admit that I can find the answer to my question by looking into the source
code, but in the case someone as a quick answer, I will appreciate.

The sequence of operation call to my web service is the following:

1) Login operation. No SOAP header in the request, my web service
implementation is adding a SOAP header in the response (a session id). The
WSDL contains the following declaration under the wsdl:output element of the
login operation.
<wsdlsoap:header use="encoded"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";
namespace="http://jobcontrol.dmi.ascentialsoftware.com/";
message="intf:sessionHeader" part="SessionID" /> 

2) OperationXXX. The request must contain the SOAP header that was returned
by the Login operation. My web service implementation is NOT adding any
header to the response (no need to send the session id on each subsequent
operation response, only the client must send it). The WSDL contains the
following declaration under the wsdl:input element of the operationXXX
operation:
<wsdlsoap:header use="encoded"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";
namespace="http://jobcontrol.dmi.ascentialsoftware.com/";
message="intf:sessionHeader" part="SessionID" /> 

My server is using Axis 1.0, and I am using Axis 1.1 beta for the client (to
avoid the requirement of the servlet.jar as well as taking advantage of the
latest SOAP header support).
The login operation is working fine, I get my SOAP header back. But then I
am experiencing two problems:

1) For every call to OperationXXX, the SOAP header sent by the client in the
request is also in the response while my web service implementation code is
not explicitly doing something like that (my code is just checking the
presence of the header in the request and uses its value to retrieve session
information. This is only on the login operation that I explicitly add a
SOAP header to the response). Is Axis automatically sending back the SOAP
headers that it receives? I am not using/setting the SOAP actor or SOAP
mustUnderstand attributes. I checked the SOAP1.1 spec and, in any cases, the
header is not supposed to be sent back automatically, is it?

2) If the client is calling multiple time OperationXXX, the SOAP header is
duplicated as many time as OperationXXX has been called. It might be related
to problem 1: 

First OperationXXX request:

      <soapenv:Header>  
         <ns1:SessionID
xmlns:ns1="http://jobcontrol.dmi.ascentialsoftware.com/";>     
            <ID xsi:type="xsd:string">4F60DEC3C6ED7B6FB14E1806F5E8BA69</ID>

         </ns1:SessionID> 
      </soapenv:Header> 

Second OperationXXX request:

     <soapenv:Header>  
         <ns1:SessionID
xmlns:ns1="http://jobcontrol.dmi.ascentialsoftware.com/";>     
            <ID xsi:type="xsd:string">4F60DEC3C6ED7B6FB14E1806F5E8BA69</ID>

         </ns1:SessionID>  
         <ns1:SessionID
xmlns:ns1="http://jobcontrol.dmi.ascentialsoftware.com/";>     
            <ID xsi:type="xsd:string">4F60DEC3C6ED7B6FB14E1806F5E8BA69</ID>

         </ns1:SessionID> 
      </soapenv:Header> 
 
And so on ... By the way, for each of those requests, the response contains
the header only one time.

Any ideas if it is something that I am missing or a potential Axis bug?

Thanks in advance for any help.

Thomas 

Reply via email to