I have a WSDL file which is from an Axis2 Web Service. When I generate a client stub using wsimport
given the WSDL file, the resulting classes require JAXBElement
paramaters. Why is it like that?
Sample Method from one of the Generated Classes:
JAXBElement<DataBean> value;
public void setValue(JAXBElement<DataBean> value)
{
this.value = ((JAXBElement<DataBean>) value);
}
I am expecting it to look like this (without the JAXBElement):
DataBean value;
public void setValue(DataBean value)
{
this.value= (DataBean) value;
}
The tutorials I saw on the net does not set the classes to JAXBElement. What could be the problem? Please take note that the server is an Axis2 web service and the WSDL file is auto-generated by Axis2. The assumption is I have no control over the server.
How can I make it in such a way that wsimport
won't convert the parameters to JAXBElements?
Below is an excerpt from the WSDL file: (I ignored some of the tags to include only the essential tags)
<xs:element name="getData">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="getData" nillable="true" type="ax220:getData"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="getData">
<xs:sequence>
<xs:element minOccurs="0" name="value" nillable="true" type="ax219:DataBean"/>
</xs:sequence>
</xs:complexType>
<wsdl:message name="getDataRequest">
<wsdl:part name="parameters" element="ns:getData"/>
</wsdl:message>
<wsdl:message name="getDataResponse">
<wsdl:part name="parameters" element="ns:getDataResponse"/>
</wsdl:message>
<wsdl:operation name="getData">
<wsdl:input message="ns:getDataRequest" wsaw:Action="urn:getData"/>
<wsdl:output message="ns:getDataResponse" wsaw:Action="urn:getDataResponse"/>
</wsdl:operation>
<wsdl:operation name="getData">
<soap:operation soapAction="urn:getData" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getData">
<soap12:operation soapAction="urn:getData" style="document"/>
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getData">
<http:operation location="getData"/>
<wsdl:input>
<mime:content type="text/xml" part="parameters"/>
</wsdl:input>
<wsdl:output>
<mime:content type="text/xml" part="parameters"/>
</wsdl:output>
</wsdl:operation>