cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brent Moore (JIRA)" <j...@apache.org>
Subject [jira] Created: (CXF-1696) wsdl2java issues with implicit headers
Date Wed, 09 Jul 2008 21:49:31 GMT
wsdl2java issues with implicit headers
--------------------------------------

                 Key: CXF-1696
                 URL: https://issues.apache.org/jira/browse/CXF-1696
             Project: CXF
          Issue Type: Bug
          Components: Tooling
    Affects Versions: 2.0.7
            Reporter: Brent Moore


All,

I are trying to consume a wsdl file from a third party company (which we can't change) that
includes implicit headers.  We have a number of issues that we have hit while trying to make
this work:

1) When I run wsdl2java (via maven) I get the "Non unique body parts" message with the following
message:

INFO] Non unique body parts! In a port, operations must have unique operation signaure on
the wire for successful dispatch. In port {urn:_HelpDesk_Queries}_HelpDesk_QueriesSoap, Operations
"{urn:_HelpDesk_Queries}GetListBy_Requester_FullName" and "{urn:_HelpDesk_Queries}GetListBy_Requester_Login"
have the same request body block {urn:_HelpDesk_Queries}AuthenticationInfo 

With the following wsdl (edited):

<?xml version="1.0" encoding="UTF-8"?>
<definitions targetNamespace="urn:_HelpDesk_Queries" xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:s="urn:_HelpDesk_Queries" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
 <wsdl:types>
  <xsd:schema elementFormDefault="qualified" targetNamespace="urn:_HelpDesk_Queries">
   <xsd:element name="GetListBy_Requester_FullName" type="s:GetListInputMap1"/>
   <xsd:complexType name="GetListInputMap1">
    <xsd:sequence>
     <xsd:element name="Requester_Full_Name" type="xsd:string"/>
    </xsd:sequence>
   </xsd:complexType>

   <xsd:element name="GetListBy_Requester_FullNameResponse" type="s:GetListOutputMap1"/>
   <xsd:complexType name="GetListOutputMap1">
    <xsd:sequence>
     <xsd:element maxOccurs="unbounded" name="getListValues">
      <xsd:complexType>
       <xsd:sequence>
        <xsd:element minOccurs="0" name="Assignee_Login_Name" type="xsd:string"/>
        <xsd:element name="Case_ID" type="xsd:string"/>
        <xsd:element name="Case_Type" type="s:Case_TypeType"/>

        <xsd:element name="Category" type="xsd:string"/>
        <xsd:element name="Create_Time" type="xsd:dateTime"/>
        <xsd:element minOccurs="0" name="Department" type="xsd:string"/>
        <xsd:element name="Description" type="xsd:string"/>
        <xsd:element name="Item" type="xsd:string"/>
        <xsd:element minOccurs="0" name="Office" type="xsd:string"/>
        <xsd:element minOccurs="0" name="Phone_Number" type="xsd:string"/>
        <xsd:element name="Priority" type="s:PriorityType"/>
        <xsd:element minOccurs="0" name="Region" type="xsd:string"/>

        <xsd:element minOccurs="0" name="Request_Urgency" type="s:Request_UrgencyType"/>
        <xsd:element name="Requester_Login_Name" type="xsd:string"/>
        <xsd:element name="Requester_Name" type="xsd:string"/>
        <xsd:element minOccurs="0" name="Site" type="xsd:string"/>
        <xsd:element name="Source" type="s:SourceType"/>
        <xsd:element name="Status" type="s:StatusType"/>
        <xsd:element name="Submitted_By" type="xsd:string"/>
        <xsd:element name="Summary" type="xsd:string"/>
        <xsd:element name="Type" type="xsd:string"/>

        <xsd:element name="Catalog" type="xsd:string"/>
        <xsd:element name="Assigned_To_Group" type="xsd:string"/>
        <xsd:element name="Resolution_Code" type="s:Resolution_CodeType"/>
        <xsd:element name="Public_Work_Log" type="xsd:string"/>
        <xsd:element name="Private_Work_Log" type="xsd:string"/>
       </xsd:sequence>
      </xsd:complexType>
     </xsd:element>
    </xsd:sequence>

   </xsd:complexType>
   <xsd:simpleType name="Case_TypeType">
    <xsd:restriction base="xsd:string">
     <xsd:enumeration value="Incident"/>
     <xsd:enumeration value="Information"/>
     <xsd:enumeration value="Service Request"/>
     <xsd:enumeration value="Enhancement Request"/>
     <xsd:enumeration value="Problem"/>
     <xsd:enumeration value="Training"/>

    </xsd:restriction>
   </xsd:simpleType>
   <xsd:simpleType name="PriorityType">
    <xsd:restriction base="xsd:string">
     <xsd:enumeration value="4-Low"/>
     <xsd:enumeration value="3-Med"/>
     <xsd:enumeration value="2-High"/>
     <xsd:enumeration value="1-Urgent"/>
    </xsd:restriction>

   </xsd:simpleType>
   <xsd:simpleType name="Request_UrgencyType">
    <xsd:restriction base="xsd:string">
     <xsd:enumeration value="4-Low"/>
     <xsd:enumeration value="3-Medium"/>
     <xsd:enumeration value="2-High"/>
     <xsd:enumeration value="1-Critical"/>
    </xsd:restriction>
   </xsd:simpleType>

   <xsd:simpleType name="SourceType">
    <xsd:restriction base="xsd:string">
     <xsd:enumeration value="Phone"/>
     <xsd:enumeration value="Chat"/>
     <xsd:enumeration value="Walk-in"/>
     <xsd:enumeration value="Monitoring"/>
     <xsd:enumeration value="Requester"/>
     <xsd:enumeration value="Email"/>
     <xsd:enumeration value="Web"/>

     <xsd:enumeration value="Paper"/>
    </xsd:restriction>
   </xsd:simpleType>
   <xsd:simpleType name="StatusType">
    <xsd:restriction base="xsd:string">
     <xsd:enumeration value="New"/>
     <xsd:enumeration value="Assigned"/>
     <xsd:enumeration value="Work In Progress"/>
     <xsd:enumeration value="Pending"/>

     <xsd:enumeration value="Resolved"/>
     <xsd:enumeration value="Closed"/>
    </xsd:restriction>
   </xsd:simpleType>
   <xsd:simpleType name="Resolution_CodeType">
    <xsd:restriction base="xsd:string">
     <xsd:enumeration value="Successful"/>
     <xsd:enumeration value="Successful with Problems"/>
     <xsd:enumeration value="Unsuccessful"/>

     <xsd:enumeration value="Unsuccessful with Problems"/>
    </xsd:restriction>
   </xsd:simpleType>

   <xsd:element name="GetListBy_Requester_Login" type="s:GetListInputMap"/>
   <xsd:complexType name="GetListInputMap">
    <xsd:sequence>

     <xsd:element name="Requester_Login" type="xsd:string"/>
    </xsd:sequence>
   </xsd:complexType>
   <xsd:element name="GetListBy_Requester_LoginResponse" type="s:GetListOutputMap"/>
   <xsd:complexType name="GetListOutputMap">
    <xsd:sequence>
     <xsd:element maxOccurs="unbounded" name="getListValues">
      <xsd:complexType>
       <xsd:sequence>

        <xsd:element minOccurs="0" name="Assignee_Login_Name" type="xsd:string"/>
        <xsd:element name="Case_ID" type="xsd:string"/>
        <xsd:element name="Case_Type" type="s:Case_TypeType"/>
        <xsd:element name="Category" type="xsd:string"/>
        <xsd:element name="Create_Time" type="xsd:dateTime"/>
        <xsd:element minOccurs="0" name="Department" type="xsd:string"/>
        <xsd:element name="Description" type="xsd:string"/>
        <xsd:element name="Item" type="xsd:string"/>
        <xsd:element minOccurs="0" name="Office" type="xsd:string"/>

        <xsd:element minOccurs="0" name="Phone_Number" type="xsd:string"/>
        <xsd:element name="Priority" type="s:PriorityType"/>
        <xsd:element minOccurs="0" name="Region" type="xsd:string"/>
        <xsd:element minOccurs="0" name="Request_Urgency" type="s:Request_UrgencyType"/>
        <xsd:element name="Requester_Login_Name" type="xsd:string"/>
        <xsd:element name="Requester_Name" type="xsd:string"/>
        <xsd:element minOccurs="0" name="Site" type="xsd:string"/>
        <xsd:element name="Source" type="s:SourceType"/>
        <xsd:element name="Status" type="s:StatusType"/>

        <xsd:element name="Submitted_By" type="xsd:string"/>
        <xsd:element name="Summary" type="xsd:string"/>
        <xsd:element name="Type" type="xsd:string"/>
        <xsd:element name="Catalog" type="xsd:string"/>
        <xsd:element name="Assigned_To_Group" type="xsd:string"/>
        <xsd:element name="Resolution_Code" type="s:Resolution_CodeType"/>
        <xsd:element name="Public_Work_Log" type="xsd:string"/>
        <xsd:element name="Private_Work_Log" type="xsd:string"/>
       </xsd:sequence>

      </xsd:complexType>
     </xsd:element>
    </xsd:sequence>
   </xsd:complexType>

   <xsd:element name="AuthenticationInfo" type="s:AuthenticationInfo"/>
   <xsd:complexType name="AuthenticationInfo">
    <xsd:sequence>
     <xsd:element name="userName" type="xsd:string"/>
     <xsd:element name="password" type="xsd:string"/>
     <xsd:element minOccurs="0" name="authentication" type="xsd:string"/>
     <xsd:element minOccurs="0" name="locale" type="xsd:string"/>
     <xsd:element minOccurs="0" name="timeZone" type="xsd:string"/>

    </xsd:sequence>
   </xsd:complexType>
  </xsd:schema>
 </wsdl:types>

   <message name="GetListBy_Requester_LoginSoapIn">
      <part element="s:GetListBy_Requester_Login" name="parameters"/>
   </message>
   <message name="GetListBy_Requester_LoginSoapOut">
      <part element="s:GetListBy_Requester_LoginResponse" name="parameters"/>
   </message>
   <message name="GetListBy_Requester_FullNameSoapIn">
      <part element="s:GetListBy_Requester_FullName" name="parameters"/>
   </message>
   <message name="GetListBy_Requester_FullNameSoapOut">
      <part element="s:GetListBy_Requester_FullNameResponse" name="parameters"/>
   </message>
   <message name="ARAuthenticate">
      <part element="s:AuthenticationInfo" name="parameters"/>
   </message>

   <portType name="_HelpDesk_QueriesPortType">
      <operation name="GetListBy_Requester_FullName">
         <input message="s:GetListBy_Requester_FullNameSoapIn"/>
         <output message="s:GetListBy_Requester_FullNameSoapOut"/>
      </operation>
      <operation name="GetListBy_Requester_Login">
         <input message="s:GetListBy_Requester_LoginSoapIn"/>
         <output message="s:GetListBy_Requester_LoginSoapOut"/>
      </operation>
   </portType>

   <binding name="_HelpDesk_QueriesSoapBinding" type="s:_HelpDesk_QueriesPortType">
      <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
      <operation name="GetListBy_Requester_FullName">
         <soap:operation soapAction="urn:_HelpDesk_Queries/GetListBy_Requester_FullName"
style="document"/>
         <input>
            <soap:header message="s:ARAuthenticate" part="parameters" use="literal">
            </soap:header>
            <soap:body use="literal"/>
         </input>
         <output>
            <soap:body use="literal"/>
         </output>
      </operation>
      <operation name="GetListBy_Requester_Login">
         <soap:operation soapAction="urn:_HelpDesk_Queries/GetListBy_Requester_Login" style="document"/>
         <input>
            <soap:header message="s:ARAuthenticate" part="parameters" use="literal">
            </soap:header>
            <soap:body use="literal"/>
         </input>
         <output>
            <soap:body use="literal"/>
         </output>
      </operation>
   </binding>
   <service name="_HelpDesk_QueriesService">
      <port binding="s:_HelpDesk_QueriesSoapBinding" name="_HelpDesk_QueriesSoap">
         <soap:address location="http://someserver/ARService?server=server&webService=_HelpDesk_Queries"/>
      </port>
   </service>
</definitions>

Note that the signature error is pointing to the implicit header and not the actual messages.

2)  I then removed the operation for GetListBy_Requester_FullName from the wsdl and generated
again.  I got the following (with -client -extsh true specified as parameters to wsdl2java)
code in the port type:

   @ResponseWrapper(localName = "GetListBy_Requester_LoginResponse", targetNamespace = "urn:_HelpDesk_Queries",
className = "_helpdesk_queries.GetListOutputMap")
    @RequestWrapper(localName = "AuthenticationInfo", targetNamespace = "urn:_HelpDesk_Queries",
className = "_helpdesk_queries.AuthenticationInfo")
    @WebResult(name = "getListValues", targetNamespace = "urn:_HelpDesk_Queries")
    @WebMethod(operationName = "GetListBy_Requester_Login", action = "urn:_HelpDesk_Queries/GetListBy_Requester_Login")
    public java.util.List<_helpdesk_queries.GetListOutputMap.GetListValues> getListByRequesterLogin(
        @WebParam(name = "userName", targetNamespace = "urn:_HelpDesk_Queries")
        java.lang.String userName,
        @WebParam(name = "password", targetNamespace = "urn:_HelpDesk_Queries")
        java.lang.String password,
        @WebParam(name = "authentication", targetNamespace = "urn:_HelpDesk_Queries")
        java.lang.String authentication,
        @WebParam(name = "locale", targetNamespace = "urn:_HelpDesk_Queries")
        java.lang.String locale,
        @WebParam(name = "timeZone", targetNamespace = "urn:_HelpDesk_Queries")
        java.lang.String timeZone,
        @WebParam(name = "AuthenticationInfo", targetNamespace = "urn:_HelpDesk_Queries",
header = true)
        AuthenticationInfo parameters
    );
}

The @RequestWrapper is the header, not the GetListBy_Requester_Login message as it should
be. The elements of the header are also specified as individual parameters along with the
header object.

 I generated the same request in Metro and got the following:

    @WebMethod(operationName = "GetListBy_Requester_Login", action = "urn:_HelpDesk_Queries/GetListBy_Requester_Login")
    @WebResult(name = "getListValues", targetNamespace = "urn:_HelpDesk_Queries")
    @RequestWrapper(localName = "GetListBy_Requester_Login", targetNamespace = "urn:_HelpDesk_Queries",
className = "_helpdesk_queri
es.GetListInputMap")
    @ResponseWrapper(localName = "GetListBy_Requester_LoginResponse", targetNamespace = "urn:_HelpDesk_Queries",
className = "_helpd
esk_queries.GetListOutputMap")
    public List<_helpdesk_queries.GetListOutputMap.GetListValues> getListByRequesterLogin(
        @WebParam(name = "Requester_Login", targetNamespace = "urn:_HelpDesk_Queries")
        String requesterLogin,
        @WebParam(name = "AuthenticationInfo", targetNamespace = "urn:_HelpDesk_Queries",
header = true, partName = "parameters")
        AuthenticationInfo parameters);

Which is more along the lines of what I would expect.  I also can run metro on the whole wsdl
without having a problem with the duplicate signatures.  

My supposition is that both of these problems are related to recognition of the implicit header
as part of the message and not as a separate header.  

Any ideas or suggestions would be appreciated.  I found a thread from about a year ago with
something similar, but didn't see a final resolution.

I am running 2.0.7 release code for the wsdl2java. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message