[ https://issues.apache.org/jira/browse/CXF-2136?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Daniel Kulp resolved CXF-2136. ------------------------------ Resolution: Invalid Fix Version/s: Invalid Assignee: Daniel Kulp > [CXF2.2][wsdl2java][RPC/Lit] Unable to create stubs > --------------------------------------------------- > > Key: CXF-2136 > URL: https://issues.apache.org/jira/browse/CXF-2136 > Project: CXF > Issue Type: Bug > Components: Tooling > Affects Versions: 2.2 > Environment: Java 6 > Reporter: Gabo Manuel > Assignee: Daniel Kulp > Fix For: Invalid > > > Not sure how to attach so I am pasting the code here directly: > Error message: > WSDLToJava Error: Non unique body parts! In a port, operations must have > unique operation signaure on the wire for successful dispatch. In port > {http://domain.some/}MyObjectServicePort, Operations > "{http://domain.some/}insertMyObject" and > "{http://domain.some/}updateMyObject" have the same request body block > {http://domain.some/}MyObject > Command line: > D:\java\cxf\apache-cxf-2.2\bin>wsdl2java -ant -client -autoNameResolution > -exsh true -d ClientDir MyObjects.wsdl > MyObject.java: > package some.domain; > import javax.xml.bind.annotation.XmlAccessType; > import javax.xml.bind.annotation.XmlAccessorType; > import javax.xml.bind.annotation.XmlRootElement; > import javax.xml.bind.annotation.XmlType; > @XmlType(name="MyObject") > @XmlAccessorType(XmlAccessType.PROPERTY) > @XmlRootElement(name="MyObject") > public class MyObject{ > } > package-info.java: > @javax.xml.bind.annotation.XmlSchema(namespace = "http://domain.some/", > elementFormDefault = > javax.xml.bind.annotation.XmlNsForm.QUALIFIED > ) > package some.domain; > MyService.java: > package some.domain; > import javax.jws.WebMethod; > import javax.jws.WebParam; > import javax.jws.WebService; > import javax.jws.soap.SOAPBinding; > import javax.jws.soap.SOAPBinding.Style; > import javax.jws.soap.SOAPBinding.Use; > import org.apache.log4j.Logger; > @WebService(serviceName="MyObjectService", portName="MyObjectServicePort") > @SOAPBinding(use=Use.LITERAL, style=Style.RPC) > public class MyService{ > private static Logger logger = Logger.getLogger(MyService.class); > > @WebMethod > public int deleteMyObject( > @WebParam(name="longField1") > long longField1){ > logger.info("delete MyObject received: " + longField1); > return 1; > } > > @WebMethod > public MyObject getMyObject( > @WebParam(name="longField1") > long longField1){ > logger.info("get MyObject received: " + longField1); > > return generateMyObject(); > } > @WebMethod > public long insertMyObject( > @WebParam(name="myObject") > MyObject myObject){ > logger.info("insert MyObject Received: " + myObject); > > return 2; > } > @WebMethod > public int updateMyObject( > @WebParam(name="myObject") > MyObject myObject){ > logger.info("update MyObject Received: " + myObject); > return 3; > } > > private static MyObject generateMyObject(){ > MyObject myObject = new MyObject(); > > long tempLong = 1; > > myObject.setStringField1("S:"+tempLong++); > myObject.setStringField2("S:"+tempLong++); > myObject.setLongField1(tempLong++); > myObject.setLongField2(tempLong++); > > return myObject; > } > } > beans.xml: > <?xml version="1.0" encoding="UTF-8"?> > <beans xmlns="http://www.springframework.org/schema/beans" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xmlns:jaxws="http://cxf.apache.org/jaxws" > xmlns:soap="http://cxf.apache.org/bindings/soap" > xsi:schemaLocation="http://www.springframework.org/schema/beans > http://www.springframework.org/schema/beans/spring-beans-2.0.xsd > http://cxf.apache.org/bindings/soap > http://cxf.apache.org/schemas/configuration/soap.xsd > http://cxf.apache.org/jaxws > http://cxf.apache.org/schemas/jaxws.xsd"> > <import resource="classpath:META-INF/cxf/cxf.xml" /> > <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" /> > <import resource="classpath:META-INF/cxf/cxf-servlet.xml" /> > <jaxws:endpoint > id="mySoapService" > address="/soap/MyObjects" > implementor="some.domain.MyService" > > > </jaxws:endpoint> > </beans> > MyObjects.wsdl: > <?xml version='1.0' encoding='UTF-8'?><wsdl:definitions > name="MyObjectService" targetNamespace="http://domain.some/" > xmlns:ns1="http://cxf.apache.org/bindings/xformat" > xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" > xmlns:tns="http://domain.some/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" > xmlns:xsd="http://www.w3.org/2001/XMLSchema"> > <wsdl:types> > <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" > targetNamespace="http://domain.some/" xmlns:tns="http://domain.some/" > xmlns:xs="http://www.w3.org/2001/XMLSchema"> > <xs:element name="MyObject" type="tns:MyObject" /> > <xs:complexType name="MyObject"> > <xs:sequence> > <xs:element name="longField1" type="xs:long" /> > <xs:element name="longField2" type="xs:long" /> > <xs:element minOccurs="0" name="stringField1" type="xs:string" /> > <xs:element minOccurs="0" name="stringField2" type="xs:string" /> > </xs:sequence> > </xs:complexType> > </xs:schema> > </wsdl:types> > <wsdl:message name="updateMyObject"> > <wsdl:part element="tns:MyObject" name="myObject"> > </wsdl:part> > </wsdl:message> > <wsdl:message name="getMyObjectResponse"> > <wsdl:part element="tns:MyObject" name="return"> > </wsdl:part> > </wsdl:message> > <wsdl:message name="getMyObject"> > <wsdl:part name="longField1" type="xsd:long"> > </wsdl:part> > </wsdl:message> > <wsdl:message name="insertMyObjectResponse"> > <wsdl:part name="return" type="xsd:long"> > </wsdl:part> > </wsdl:message> > <wsdl:message name="insertMyObject"> > <wsdl:part element="tns:MyObject" name="myObject"> > </wsdl:part> > </wsdl:message> > <wsdl:message name="deleteMyObjectResponse"> > <wsdl:part name="return" type="xsd:int"> > </wsdl:part> > </wsdl:message> > <wsdl:message name="updateMyObjectResponse"> > <wsdl:part name="return" type="xsd:int"> > </wsdl:part> > </wsdl:message> > <wsdl:message name="deleteMyObject"> > <wsdl:part name="longField1" type="xsd:long"> > </wsdl:part> > </wsdl:message> > <wsdl:portType name="MyService"> > <wsdl:operation name="updateMyObject"> > <wsdl:input message="tns:updateMyObject" name="updateMyObject"> > </wsdl:input> > <wsdl:output message="tns:updateMyObjectResponse" > name="updateMyObjectResponse"> > </wsdl:output> > </wsdl:operation> > <wsdl:operation name="insertMyObject"> > <wsdl:input message="tns:insertMyObject" name="insertMyObject"> > </wsdl:input> > <wsdl:output message="tns:insertMyObjectResponse" > name="insertMyObjectResponse"> > </wsdl:output> > </wsdl:operation> > <wsdl:operation name="getMyObject"> > <wsdl:input message="tns:getMyObject" name="getMyObject"> > </wsdl:input> > <wsdl:output message="tns:getMyObjectResponse" > name="getMyObjectResponse"> > </wsdl:output> > </wsdl:operation> > <wsdl:operation name="deleteMyObject"> > <wsdl:input message="tns:deleteMyObject" name="deleteMyObject"> > </wsdl:input> > <wsdl:output message="tns:deleteMyObjectResponse" > name="deleteMyObjectResponse"> > </wsdl:output> > </wsdl:operation> > </wsdl:portType> > <wsdl:binding name="MyObjectServiceSoapBinding" type="tns:MyService"> > <soap:binding style="rpc" > transport="http://schemas.xmlsoap.org/soap/http" /> > <wsdl:operation name="updateMyObject"> > <soap:operation soapAction="" style="rpc" /> > <wsdl:input name="updateMyObject"> > <soap:body namespace="http://domain.some/" use="literal" /> > </wsdl:input> > <wsdl:output name="updateMyObjectResponse"> > <soap:body namespace="http://domain.some/" use="literal" /> > </wsdl:output> > </wsdl:operation> > <wsdl:operation name="insertMyObject"> > <soap:operation soapAction="" style="rpc" /> > <wsdl:input name="insertMyObject"> > <soap:body namespace="http://domain.some/" use="literal" /> > </wsdl:input> > <wsdl:output name="insertMyObjectResponse"> > <soap:body namespace="http://domain.some/" use="literal" /> > </wsdl:output> > </wsdl:operation> > <wsdl:operation name="getMyObject"> > <soap:operation soapAction="" style="rpc" /> > <wsdl:input name="getMyObject"> > <soap:body namespace="http://domain.some/" use="literal" /> > </wsdl:input> > <wsdl:output name="getMyObjectResponse"> > <soap:body namespace="http://domain.some/" use="literal" /> > </wsdl:output> > </wsdl:operation> > <wsdl:operation name="deleteMyObject"> > <soap:operation soapAction="" style="rpc" /> > <wsdl:input name="deleteMyObject"> > <soap:body namespace="http://domain.some/" use="literal" /> > </wsdl:input> > <wsdl:output name="deleteMyObjectResponse"> > <soap:body namespace="http://domain.some/" use="literal" /> > </wsdl:output> > </wsdl:operation> > </wsdl:binding> > <wsdl:service name="MyObjectService"> > <wsdl:port binding="tns:MyObjectServiceSoapBinding" > name="MyObjectServicePort"> > <soap:address location="http://222.127.215.100:8030/soap/MyObjects" /> > </wsdl:port> > </wsdl:service> > </wsdl:definitions> > Reference thread: > http://www.nabble.com/-CXF2.2--wsdl2java--RPC-Lit--Unable-to-create-stubs-td22698336.html -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.