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 "Franklin, Allen" <Al...@avocent.com> on 2008/08/14 18:28:11 UTC

"Bad" header is generated by my Axis2-based client?

Does anyone know why my axis2 version 1.4 client generates a SOAP header
that my server (axis1)

cannot understand?

 

The "bad" header is generated by my Axis2-based client.

The "good" header is generated by the open-source SOAPui tool.

Both clients are using the same wsdl.

The bad header seems to be missing the prefix "ns1:" from the
credentials element and its subelements.

 

Axis2 generated the SessionHeader class (from wsdl) that I pass on my
stub call in my client code:

 

  SessionHeader m_SessionHeader = new SessionHeader();

  stub.getMetric(m_GetMetric, m_SessionHeader);

 

Bad header looks like this:

  <soapenv:Header>

    <ns3:sessionHeader 

       xmlns:ns3 ="urn:units:webservices:server:dsview:avocent:com">

       <credentials 

           xmlns ="urn:common:webservices:server:dsview:avocent:com">

           <sessionId>1 mwefcmso5x3o</sessionId>

           <service name>afranklin</servicename>

           <password>avocent</password>

       </credentials>

    </ns3:sessionHeader>

   </soapenv:Header>

 

Good header looks like this:

   <soapenv:Header>

      <ns1:sessionHeader                 

          xmlns:ns1="urn:common:webservices:server:dsview:avocent:com">

          <ns1:credentials>                            

               <ns1:sessionId>1mwefcmso5x3o</ns1:sessionId>

               <ns1:servicename>afranklin</ns1:servicename>

               <ns1:password>avocent</ns1:password>

          </ns1:credentials>

       </ns1:sessionHeader>  

   </soapenv:Header>

 

Snippet of the wsdl that describes the operation I am calling
(getMetric()):

 

    <operation name="getMetric">

      <documentation>

           Service operation to obtain metrics on a single unit.

      </documentation>

      <SOAP:operation style="document" 

 
soapAction="urn:units:webservices:server:dsview:avocent:com#getMetric"/>

      <input>

           <SOAP:header use="literal" message="ns:sessionHeader"
part="sessionHeader"/>

           <SOAP:body parts="parameters" use="literal"/>

      </input>

      <output>

           <SOAP:header use="literal" message="ns:sessionHeader"
part="sessionHeader"/>

           <SOAP:body use="literal"/>

      </output>

    </operation>

 

(I am afraid to post the entire wsdl because it is proprietary and I may
get into trouble with my company.)