[
https://issues.apache.org/jira/browse/CXF-1223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12554836
]
David Fladung commented on CXF-1223:
------------------------------------
I'm experiencing a very similar issue, however, instead of generating code with
no arguments or return types, all of the parameters end up as arguments to the
generated Java method, with Mode.OUT assigned to the logical output parameters.
If I change the type definition name everything works as expected.
<?xml version='1.0' encoding='UTF-8' ?>
<definitions name='NetworkNode2'
targetNamespace='http://www.exchangenetwork.net/wsdl/node/2'
xmlns:tns='http://www.exchangenetwork.net/wsdl/node/2'
xmlns:xsd='http://www.w3.org/2001/XMLSchema'
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
xmlns:typens='http://www.exchangenetwork.net/schema/node/2'
xmlns='http://schemas.xmlsoap.org/wsdl/'>
<types>
<schema
targetNamespace='http://www.exchangenetwork.net/schema/node/2'
xmlns='http://www.w3.org/2001/XMLSchema'
xmlns:xmime="http://www.w3.org/2005/05/xmlmime"
elementFormDefault='qualified'>
<import namespace="http://www.w3.org/2005/05/xmlmime"
schemaLocation="http://www.w3.org/2005/05/xmlmime" />
<element name="NodeFaultDetailType">
<complexType>
<sequence>
<element name="Description"
type="xsd:string" minOccurs="1" maxOccurs="1" nillable="false" />
</sequence>
</complexType>
</element>
<complexType name="StatusResponseType">
<annotation>
<documentation>
The status response type
contains three elements: transactionId : The UUID for the transaction.
status: The current status of
the transaction. A transaction can be successful or failed
immediately. message: A text
description of errors if any.
</documentation>
</annotation>
<sequence>
<element name='transactionId'
type='xsd:string' />
<element name='statusDetail'
type='xsd:string' />
</sequence>
</complexType>
<element name="Submit">
<complexType>
<sequence>
<element name='securityToken'
type='xsd:string' />
<element name='transactionId'
type='xsd:string' />
<element name='dataflow'
type='xsd:NCName' />
<element name='flowOperation'
type='xsd:string' />
<element name='recipients'
type='xsd:string' />
<element name='notificationURI'
type='xsd:string' />
</sequence>
</complexType>
</element>
<element name="SubmitResponse"
type="typens:StatusResponseType" />
</schema>
</types>
<message name='SubmitRequest'>
<part name='in' element='typens:Submit' />
</message>
<message name='SubmitResponse'>
<part name='out' element='typens:SubmitResponse' />
</message>
<message name='NodeFaultMessage'>
<part name='fault' element='typens:NodeFaultDetailType' />
</message>
<portType name='NetworkNodePortType2'>
<operation name='Submit'>
<documentation>Submit one or more documents to the
node.</documentation>
<input message='tns:SubmitRequest' name="SubmitRequest"
/>
<output message='tns:SubmitResponse'
name="SubmitResponse" />
<fault name='NodeFaultDetail'
message='tns:NodeFaultMessage' />
</operation>
</portType>
<binding name='NetworkNodeBinding2' type='tns:NetworkNodePortType2'>
<soap12:binding style='document'
transport='http://schemas.xmlsoap.org/soap/http' />
<operation name='Submit'>
<soap12:operation style="document" soapAction='' />
<input name="SubmitRequest">
<soap12:body use='literal' />
</input>
<output name="SubmitResponse">
<soap12:body use='literal' />
</output>
<fault name="NodeFaultDetail">
<soap12:fault name='NodeFaultDetail'
use='literal' />
</fault>
</operation>
</binding>
<service name='NetworkNode2'>
<documentation>Network Node 2.0 definitions for the
Environmental Information Exchange Network</documentation>
<port name='NetworkNodePort2' binding='tns:NetworkNodeBinding2'>
<soap12:address
location='http://localhost/xml/node_v20_draft.wsdl' />
</port>
</service>
</definitions>
@ResponseWrapper(targetNamespace =
"http://www.exchangenetwork.net/schema/node/2", className =
"net.exchangenetwork.node2.schema.StatusResponseType", localName =
"SubmitResponse")
@RequestWrapper(targetNamespace =
"http://www.exchangenetwork.net/schema/node/2", className =
"net.exchangenetwork.node2.schema.Submit", localName = "Submit")
@WebMethod(operationName = "Submit")
public void submit(
@WebParam(targetNamespace =
"http://www.exchangenetwork.net/schema/node/2", name = "securityToken")
java.lang.String securityToken,
@WebParam(targetNamespace =
"http://www.exchangenetwork.net/schema/node/2", mode = Mode.INOUT, name =
"transactionId")
javax.xml.ws.Holder<java.lang.String> transactionId,
@WebParam(targetNamespace =
"http://www.exchangenetwork.net/schema/node/2", name = "dataflow")
java.lang.String dataflow,
@WebParam(targetNamespace =
"http://www.exchangenetwork.net/schema/node/2", name = "flowOperation")
java.lang.String flowOperation,
@WebParam(targetNamespace =
"http://www.exchangenetwork.net/schema/node/2", name = "recipients")
java.lang.String recipients,
@WebParam(targetNamespace =
"http://www.exchangenetwork.net/schema/node/2", name = "notificationURI")
java.lang.String notificationURI,
@WebParam(targetNamespace =
"http://www.exchangenetwork.net/schema/node/2", mode = Mode.OUT, name =
"statusDetail")
javax.xml.ws.Holder<java.lang.String> statusDetail
) throws NodeFaultMessage;
> Client code generates no parameters or return values for WSDL with multiple
> elements with same name
> ---------------------------------------------------------------------------------------------------
>
> Key: CXF-1223
> URL: https://issues.apache.org/jira/browse/CXF-1223
> Project: CXF
> Issue Type: Bug
> Affects Versions: 2.0.3
> Environment: Windows, OS X, Linux
> Reporter: Peter Liljenberg
> Assignee: jimma
> Priority: Blocker
> Fix For: 2.1
>
>
> When generating code with wsdl2java we end up with client code that have no
> parameters or return values for our methods.
> Complete WSDL:
> <?xml version="1.0" encoding="UTF-8"?>
> <definitions xmlns:tns="mesh.meshfacade"
> xmlns:wsr="http://www.openuri.org/2002/10/soap/reliability/"
> xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
> xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
> xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:soap12enc="http://www.w3.org/2003/05/soap-encoding"
> xmlns:conv="http://www.openuri.org/2002/04/wsdl/conversation/"
> xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> xmlns:s="http://www.w3.org/2001/XMLSchema"
> xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="mesh.meshfacade">
> <types>
> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:stns="java:mesh.meshfacade.vo" elementFormDefault="qualified"
> attributeFormDefault="qualified" targetNamespace="java:mesh.meshfacade.vo">
> <xsd:import namespace="java:efsbase.common">
> </xsd:import>
> <xsd:complexType name="CreateMailboxRequest">
> <xsd:complexContent>
> <xsd:extension xmlns:tp="java:efsbase.common"
> base="tp:EFSBaseMSISDNRequest">
> <xsd:sequence>
> <xsd:element type="xsd:string" name="domain" minOccurs="1"
> maxOccurs="1" nillable="true">
> </xsd:element>
> </xsd:sequence>
> </xsd:extension>
> </xsd:complexContent>
> </xsd:complexType>
> <xsd:complexType name="CreateMailboxResponse">
> <xsd:complexContent>
> <xsd:extension xmlns:tp="java:efsbase.common" base="tp:EFSBaseResponse">
> </xsd:extension>
> </xsd:complexContent>
> </xsd:complexType>
> </xsd:schema>
> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:stns="mesh.meshfacade" elementFormDefault="qualified"
> attributeFormDefault="qualified" targetNamespace="mesh.meshfacade">
> <xsd:import namespace="java:mesh.meshfacade.vo">
> </xsd:import>
> <xsd:element xmlns:tp="java:mesh.meshfacade.vo"
> type="tp:CreateMailboxRequest" name="createMailbox" nillable="true">
> </xsd:element>
> <xsd:element xmlns:tp="java:mesh.meshfacade.vo"
> type="tp:CreateMailboxResponse" name="createMailboxResponse" nillable="true">
> </xsd:element>
> </xsd:schema>
> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:stns="java:efsbase.common" elementFormDefault="qualified"
> attributeFormDefault="qualified" targetNamespace="java:efsbase.common">
> <xsd:complexType name="EFSBaseMSISDNRequest">
> <xsd:complexContent>
> <xsd:extension base="stns:EFSBaseRequest">
> <xsd:sequence>
> <xsd:element type="xsd:string" name="msisdn" minOccurs="1"
> maxOccurs="1" nillable="true">
> </xsd:element>
> </xsd:sequence>
> </xsd:extension>
> </xsd:complexContent>
> </xsd:complexType>
> <xsd:complexType name="EFSBaseObject">
> </xsd:complexType>
> <xsd:complexType name="EFSBaseRequest">
> <xsd:complexContent>
> <xsd:extension base="stns:EFSBaseObject">
> <xsd:sequence>
> <xsd:element type="xsd:string" name="userId" minOccurs="1"
> maxOccurs="1" nillable="true">
> </xsd:element>
> </xsd:sequence>
> </xsd:extension>
> </xsd:complexContent>
> </xsd:complexType>
> <xsd:complexType name="EFSBaseResponse">
> <xsd:complexContent>
> <xsd:extension base="stns:EFSBaseObject">
> <xsd:sequence>
> <xsd:element type="xsd:string" name="transactionId" minOccurs="1"
> maxOccurs="1" nillable="true">
> </xsd:element>
> </xsd:sequence>
> </xsd:extension>
> </xsd:complexContent>
> </xsd:complexType>
> </xsd:schema>
> </types>
> <message name="createMailbox">
> <part xmlns:partns="mesh.meshfacade" name="createMailboxRequest"
> element="partns:createMailbox">
> </part>
> </message>
> <message name="createMailboxResponse">
> <part xmlns:partns="mesh.meshfacade" name="result"
> element="partns:createMailboxResponse">
> </part>
> </message>
> <portType name="MeshFacadePort">
> <operation name="createMailbox">
> <input message="tns:createMailbox">
> </input>
> <output message="tns:createMailboxResponse">
> </output>
> </operation>
> </portType>
> <binding type="tns:MeshFacadePort" name="MeshFacadePort">
> <soap:binding style="document"
> transport="http://schemas.xmlsoap.org/soap/http"/>
> <operation name="createMailbox">
> <soap:operation style="document" soapAction=""/>
> <input>
> <soap:body use="literal"/>
> </input>
> <output>
> <soap:body use="literal"/>
> </output>
> </operation>
> </binding>
> <service name="MeshFacade">
> <port name="MeshFacadePort" binding="tns:MeshFacadePort">
> <soap:address location="http://localhost/mesh/MeshFacade"/>
> </port>
> </service>
> </definitions>
> Generated code:
> public interface MeshFacadePort {
> @ResponseWrapper(targetNamespace = "mesh.meshfacade", className =
> "java.mesh_meshfacade.CreateMailboxResponse", localName =
> "createMailboxResponse")
> @RequestWrapper(targetNamespace = "mesh.meshfacade", className =
> "java.mesh_meshfacade.CreateMailboxRequest", localName = "createMailbox")
> @WebMethod
> public void createMailbox();
> }
> Clearly we expected the method to have a parameter and return value. I'm
> guessing (this has been an issue before CXF-1502) that the problem is that
> there are 2 elements "createMailbox", one type definition and one
> method/operation definition. Is this OK according to the WSDL specs or is it
> a bug in CXF? Other frameworks like Axis can generate a "correct", working
> client from the WSDL.
> Updated WSDL (snippet):
> <portType name="MeshFacadePort">
> <operation name="createMailbox2">
> <input message="tns:createMailbox">
> </input>
> <output message="tns:createMailboxResponse">
> </output>
> </operation>
> </portType>
> <binding type="tns:MeshFacadePort" name="MeshFacadePort">
> <soap:binding style="document"
> transport="http://schemas.xmlsoap.org/soap/http"/>
> <operation name="createMailbox2">
> <soap:operation style="document" soapAction=""/>
> <input>
> <soap:body use="literal"/>
> </input>
> <output>
> <soap:body use="literal"/>
> </output>
> </operation>
> </binding>
> With different names we get the following, more correct code:
> public interface MeshFacadePort {
> @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
> @WebResult(targetNamespace = "mesh.meshfacade", partName = "result", name
> = "createMailboxResponse")
> @WebMethod
> public java.mesh_meshfacade.CreateMailboxResponse createMailbox2(
> @WebParam(targetNamespace = "mesh.meshfacade", partName =
> "createMailboxRequest", name = "createMailbox")
> java.mesh_meshfacade.CreateMailboxRequest createMailboxRequest
> );
> }
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.