6 Replies Latest reply on Jun 27, 2005 12:49 PM by clairecostello

    WSDL duplicate operations

    clairecostello

      Hi All,

      JBoss 4.0.2
      JDK/JRE 5
      Win XP Advanced Server.

      I need help with my WSDL. I have duplicate operation names in my interfaces, but with different input params. When I deploy to JBoss it throws the following error:


      org.jboss.deployment.DeploymentException: Cannot deploy webservice; - nested throwable: (java.lang.IllegalArgumentException: Duplicate operation with name=getModel, found in portType '{http://mynamespace}
      ModelServicesEndpointSoapBinding'.)


      Partial WSDL file below. XDoclet generated with Java2WSDL:


      <wsdl:message name="getModelResponse1">

      <wsdl:part name="getModelReturn" type="xsd:string"/>

      </wsdl:message>

      <wsdl:message name="getModelResponse">

      <wsdl:part name="getModelReturn" type="xsd:string"/>

      </wsdl:message>

      <wsdl:message name="getModelRequest">

      <wsdl:part name="in0" type="xsd:string"/>

      </wsdl:message>

      ...

      <wsdl:message name="getModelRequest1">

      </wsdl:message>

      ...

      <wsdl:operation name="getModel" parameterOrder="in0">

      <wsdl:input message="impl:getModelRequest" name="getModelRequest"/>

      <wsdl:output message="impl:getModelResponse" name="getModelResponse"/>

      </wsdl:operation>

      <wsdl:operation name="getModel">

      <wsdl:input message="impl:getModelRequest1" name="getModelRequest1"/>

      <wsdl:output message="impl:getModelResponse1" name="getModelResponse1"/>

      </wsdl:operation>

      ...

      The binding...

      <wsdl:operation name="getModel">

      <wsdlsoap:operation soapAction=""/>

      <wsdl:input name="getModelRequest">

      <wsdlsoap:body namespace="http://ModelManager.process.iwise.com" use="literal"/>

      </wsdl:input>

      <wsdl:output name="getModelResponse">

      <wsdlsoap:body namespace="http://ModelManager.process.iwise.com" use="literal"/>

      </wsdl:output>

      </wsdl:operation>

      <wsdl:operation name="getModel">

      <wsdlsoap:operation soapAction=""/>

      <wsdl:input name="getModelRequest1">

      <wsdlsoap:body namespace="http://ModelManager.process.iwise.com" use="literal"/>

      </wsdl:input>

      <wsdl:output name="getModelResponse1">

      <wsdlsoap:body namespace="http://ModelManager.process.iwise.com" use="literal"/>

      </wsdl:output>

      </wsdl:operation>


      ...

      Endpoint class contains the following methods:
       public String getModel() throws RemoteException;
       public String getModel(String parentProcessID) throws RemoteException;
      


      Anyone any ideas (besides renaming the operations?)
      TIA, Claire.

        • 1. Re: WSDL duplicate operations
          mvlst2

          Have a look at my article over here: http://www.devsource.com/article2/0,1759,1828651,00.asp It is mostly related to .NET, but everything about WSDL, messages, and methods would still apply to Axis / JBoss.

          Hope this helps
          max@jbossfaq.com
          ------------------------
          http://www.jbossfaq.com
          is hosted on http://www.thebeancontainer.com

          • 2. Re: WSDL duplicate operations
            clairecostello

            Thanks Max. I'll take a look at the article and see how it works out.

            • 3. Re: WSDL duplicate operations
              clairecostello

              Hi Max,

              After reading your article I made sure that the message parts had different names in their definitions and used them for overloading the same WSDL method: getModel(). The WSDL bindings for the method uses the different message parts as appropriate.

              Here is the binding generated by Java2WSDL. It shows that the input and outputs refer to different message names:

               <wsdl:operation name="getModel">
              
               <wsdlsoap:operation soapAction=""/>
              
               <wsdl:input name="getModelRequest">
              
               <wsdlsoap:body namespace="http://url.com" use="literal"/>
              
               </wsdl:input>
              
               <wsdl:output name="getModelResponse">
              
               <wsdlsoap:body namespace="http://url.com" use="literal"/>
              
               </wsdl:output>
              
               </wsdl:operation>
              
               <wsdl:operation name="getModel">
              
               <wsdlsoap:operation soapAction=""/>
              
               <wsdl:input name="getModelRequest1">
              
               <wsdlsoap:body namespace="http://url.com" use="literal"/>
              
               </wsdl:input>
              
               <wsdl:output name="getModelResponse1">
              
               <wsdlsoap:body namespace="http://url.com" use="literal"/>
              
               </wsdl:output>
              
               </wsdl:operation>
              


              JBoss WS deployer just doesn't like duplicate operation names, it seems.

              Your articles points out that WSDL 1.2 dropped method overloading and WS-I Basic Profile 1.0 has no method overloading. Am I trying to do something here that cannot be achieved in JBossWS?

              Any ideas?
              Claire.

              • 4. Re: WSDL duplicate operations
                jason.greene

                J2EE webservices must adhere to WS-I Basic Profile 1.0, which JBossWS does.

                -Jason

                • 5. Re: WSDL duplicate operations
                  anil.saldhana

                  We all want to do advanced stuff in wsdl files, based on our business requirements. But the eventual goal should be to make your webservices portable(across containers) and interoperable(with .Net).

                  J2EE 1.4 web services (which JBossWS supports) has support for WSDL 1.1 (which allows method overloading). But J2EE 1.4 also has strict WS-I BP 1.0 compliance. As you can see in section 5.4.3, method name overloading, is discouraged.
                  http://www.ws-i.org/Profiles/BasicProfile-1.0-2004-04-16.html

                  Try to do a workaround and be happy that your webservices will be interoperable/portable.

                  • 6. Re: WSDL duplicate operations
                    clairecostello

                    Thanks for the feedback. I shall simply rename WS operations (for use within the same portType at least).

                    Claire.