I have aa.xsd as below.
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://wwwtest.com/test" xmlns:abc="http://wwwtest.com/test">
<xs:simpleType name="APP_TYPE">
<xs:restriction base="xs:string">
<xs:enumeration value="ABC" />
<xs:enumeration value="DEF" />
</xs:restriction>
</xs:simpleType>
<xs:element name="RootElement" type="abc:RootElementType" />
<xs:complexType name="RootElementType">
<xs:choice>
<xs:sequence>
<xs:element ref="abc:UserRequest" />
<xs:any minOccurs="0" />
</xs:sequence>
<xs:sequence>
<xs:element ref="abc:UserResponse" />
<xs:any minOccurs="0" />
</xs:sequence>
</xs:choice>
</xs:complexType>
<xs:element name="UserRequest" type="abc:UserRequestType" />
<xs:complexType name="UserRequestType">
<xs:sequence>
<xs:element name="UserLoginName" type="xs:string" />
<xs:element ref="abc:VendorApp" />
</xs:sequence>
</xs:complexType>
<xs:element name="VendorApp" type="abc:VendorAppType" />
<xs:complexType name="VendorAppType">
<xs:sequence>
<xs:element name="AppName" type="abc:APP_TYPE" />
</xs:sequence>
</xs:complexType>
<xs:element name="UserResponse" type="abc:UserResponseType" />
<xs:complexType name="UserResponseType">
<xs:sequence>
<xs:element name="SessionKey" type="xs:string" />
<xs:element name="SessionKeyExpDate" type="xs:date" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:schema>
Wrote the WSDL as below.
<?xml version="1.0" encoding="UTF-8"?><wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" name="ABCcomacc" targetNamespace="http://wwwtest.com/test/com/acc/" xmlns:abc="http://wwwtest.com/test" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:ws="http://wwwtest.com/test/com/acc/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<wsdl:types>
<xsd:schema>
<xsd:import namespace="http://wwwtest.com/test" schemaLocation="aaa.xsd"/>
</xsd:schema>
</wsdl:types>
<wsdl:message name="xyzSearchRequest">
<wsdl:part element="abc:RootElement" name="parameters"/>
</wsdl:message>
<wsdl:message name="xyzSearchResponse">
<wsdl:part element="abc:RootElement" name="parameters"/>
</wsdl:message>
<wsdl:portType name="ABCcomacc">
<wsdl:operation name="xyzSearch">
<wsdl:input message="ws:xyzSearchRequest"/>
<wsdl:output message="ws:xyzSearchResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="ABCcomaccSOAP12" type="ws:ABCcomacc">
<soap12:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="xyzSearch">
<soap12:operation soapAction="http://wwwtest.com/test/com/acc/xyzSearch"/>
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="ABCcomacc">
<wsdl:port binding="ws:ABCcomaccSOAP12" name="ABCcomaccSOAP12">
<soap12:address location="http://localhost:9080/ABCcomacc/ABCcomacc"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
My skeleton class implementation generating as below.
@javax.jws.WebService (endpointInterface="com.wwwtest.test.com.acc.ABCcomacc", targetNamespace="http://wwwtest.com/test/com/acc/", serviceName="ABCcomacc", portName="ABCcomaccSOAP12", wsdlLocation="WEB-INF/wsdl/LTCCommonAccord.wsdl")
@javax.xml.ws.BindingType (value=javax.xml.ws.soap.SOAPBinding.SOAP12HTTP_BINDING)
public class ABCcomaccSOAP12Impl{
public void xyzSearch(Holder<RootElementType> parameters) {
// TODO Auto-generated method stub
return;
}
}
This method return type is void
and method argument is Holder<RootElementType> parameters
but return type and method argument should be RootElementType.
could any one have the idea why I'm getting this output. please advice me... I'm using JAX-WS.
Have different names for request and response elements like below.
<wsdl:message name="xyzSearchRequest">
<wsdl:part element="abc:RootElement" name="reqparams"/>
</wsdl:message>
<wsdl:message name="xyzSearchResponse">
<wsdl:part element="abc:RootElement" name="respparams"/>
</wsdl:message>
How are you generating bindings ? If you using wsimport goal from maven, then write a binding file and add below in bindings section.
<enableWrapperStyle>false</enableWrapperStyle>