Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-1223

Client code generates no parameters or return values for WSDL with multiple elements with same name

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 2.0.3
    • 2.0.4
    • None
    • None
    • Windows, OS X, Linux

    Description

      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
      );
      }

      Attachments

        Issue Links

          Activity

            People

              dkulp Daniel Kulp
              pliljenberg@gmail.com Peter Liljenberg
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: