Are you using axis1.x? with axis2.x this happens automatically. thanks, Amila.
On Wed, Feb 18, 2009 at 3:38 PM, Guo Tianchong <[email protected]>wrote: > 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 > > -- Amila Suriarachchi WSO2 Inc. blog: http://amilachinthaka.blogspot.com/
