I don't konw, but you can add elements in the header with :

        QName elementName = new QName( "YOUR_ID" );
        OMFactory omFactory = OMAbstractFactory.getOMFactory();
        OMElement omElement = omFactory.createOMElement( elementName, null );
        omElement.setText( "YOUR_VALUE" );
        this._YOUR_STUB._getServiceClient().addHeader( omElement ); 


Yves-Marie 

 

 

-----Message d'origine-----
De : Guo Tianchong [mailto:[email protected]] 
Envoyé : mercredi 18 février 2009 11:09
À : axis-user
Objet : how to make classes for <soap:Header> by wsdl2java

hi all,

I am using wsdl2java command to create java class.
Now, I can create classes for my <soap:Body>'s child elements.
but, how to make classes for <soap:Header>'s child elements?

My resquest/response soap message is the following:

----> request message
<soap:Enveloper ...>
    <soap:Header>
      <mh:ID soap:mustUnderstand="1">1<mh:ID>
      <mh:MACAddress soap:mustUnderstand="1">01234567ABC<mh:ID>
    </soap:Header>
    <soap:Body>
      <mh:Inform>
        ... ...
      </mh:Inform>
    <soap:Body>
</soap:Enveloper>

---->response message
<soap:Enveloper ...>
    <soap:Header>
      <mh:ID soap:mustUnderstand="1">1<mh:ID>
      <mh:MACAddress soap:mustUnderstand="1">01234567ABC<mh:ID>
    </soap:Header>
    <soap:Body>
      <mh:InformResponse>
        ... ...
      </mh:InformResponse>
    <soap:Body>
</soap:Enveloper>


************and my .wsdl file is:
<definitions>
....
<types>
  <xsd:schema targetNamespace="...">
    <xs:element name="Inform">
      <xs:complexType>
        <xs:sequence>
          ....
        </xs:sequence>
      </xs:complexType>
    </xs:element>
    <xs:element name="InformResponse">
      <xs:complexType>
        <xs:sequence>
          ....
        </xs:sequence>
      </xs:complexType>
    </xs:element>
  </xsd:schema>
</types>

<message name="Headers">
  <part name="ID" element="tns:ID" />
  <part name="MACAddress" element="tns:MACAddress" /> </message> <message 
name="InformRequest">
  <part name="part0" element="tns:Inform" /> </message> <message 
name="InformResponse">
  <part name="part0" element="tns:InformResponse" /> </message>

.....

<binding name="Mybinding" type="tns:MyportType">
    <soap:binding style="document" 
transport="http://schemas.xmlsoap.org/soap/http"; />
    <operation name="inform">
      <soap:operation style="document" soapAction="urn:inform" />
      <input>
        <soap:header message="tns:Headers" part="ID" use="literal" />
        <soap:header message="tns:Headers" part="MACAddress" use="literal" />
        <soap:body use="literal" />
      </input>
      <output>
        <soap:header message="tns:Headers" part="ID" use="literal" />
        <soap:header message="tns:Headers" part="MACAddress" use="literal" />
        <soap:body use="literal" />
      </output>
    </operation>
  </binding>
....

</definitions>



Now, I can create InformDocument & InformResponseDocument classes, but how can 
make classes for <soap:Header> by wsdl2java?

Thanks for any help!

Guo







This message contains information that may be privileged or confidential and is 
the property of the Capgemini Group. It is 
intended only for the person to whom it is addressed. If you are not the 
intended recipient, you are not authorized to 
read, print, retain, copy, disseminate, distribute, or use this message or any 
part thereof. If you receive this message 
in error, please notify the sender immediately and delete all copies of this 
message.

Reply via email to