axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Guo Tianchong" <gu...@nec-as.nec.com.cn>
Subject how to make classes for <soap:Header> by wsdl2java
Date Wed, 18 Feb 2009 10:08:37 GMT
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


Mime
View raw message