I have Java WebService code in my eclipse. I have used @WebService @Webmethod, @XmlElements, @XmlType, @XmlAccessorType
Now I am generating wsdl using java2ws command from cxf framework. Here is the command
F:\....\code\java2wsdl>java2ws -o CustomerVxRR.wsdl -d <myOutputDir> -wsdl -cp <myClassesFolder> <ServiceImpl class>
my wsdl file contqins agr0 as name which I do not want because when I am importing it to SoapUI. It is adding tag around the field.
Here is wsdl part with arg0
<xs:schema ..... >
<xs:complexType name="myServiceMethodName">
<xs:sequence>
<xs:element minOccurs="0" name="arg0" type="tns:ServiceInputClassName"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ServiceInputClassName">
<xs:sequence>
<xs:element minOccurs="0" name="EmpID" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xz:schema>
Here is the request object which is generated in SOAPUI
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cus="http://customeroffer.manage.ws.hello.my.com/">
<soapenv:Header/>
<soapenv:Body>
<cus:myServiceMethodName>
<!--Optional:-->
<arg0>
<EmpID >123456</EmpID>
</arg0>
</cus:myServiceMethodName>
</soapenv:Body>
</soapenv:Envelope>
If I remove tag I get this response:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<soap:Fault>
<faultcode>soap:Client</faultcode>
<faultstring>Unmarshalling Error: unexpected element (uri:"", local:"EmpID"). Expected elements are <{}empid></faultstring>
</soap:Fault>
</soap:Body>
</soap:Envelope>
I do not want to keep arg0 in the request XML