0 Replies Latest reply on Feb 18, 2009 3:08 PM by samyers

    WS methods with same name in different WS classes => unexpec

    samyers

      Hi, I'm new to JbossWS and getting unexpected generated WSDLs from my simple test WebService classes when the classes (deployed in the same WAR) share common WebMethod names. I'm using JBossWS native version 3.0.4.GA in jboss-5.0.0.GA-jdk6.

      In both WebService classes there are two methods, methodOne and methodTwo. In the TestOneWeb class both methods return Integers, in the TestTwoWeb class both methods return Strings. The WSDL for TestOneWeb looks fine, but in the WSDL for TestTwoWeb both method return ints when they should return strings.

      Any help or suggestions are appreciated.

      -- Steve

      TestOneWeb.java:

      package com.ep.ff.web.endpoint.test;
      
      import javax.jws.WebMethod;
      import javax.jws.WebService;
      
      import org.apache.log4j.Logger;
      
      @WebService
      public class TestOneWeb
      {
       private static Logger logger = Logger.getLogger(TestOneWeb.class);
      
       @WebMethod
       public Integer methodOne(String number)
       {
       return new Integer(number);
       }
      
       @WebMethod
       public Integer methodTwo(String number)
       {
       return new Integer(number);
       }
      }
      


      TestTwoWeb.java:
      package com.ep.ff.web.endpoint.test;
      
      import javax.jws.WebMethod;
      import javax.jws.WebService;
      
      import org.apache.log4j.Logger;
      
      @WebService
      public class TestTwoWeb
      {
       private static Logger logger = Logger.getLogger(TestTwoWeb.class);
      
       @WebMethod
       public String methodOne(String number)
       {
       return number;
       }
      
       @WebMethod
       public String methodTwo(String number)
       {
       return number;
       }
      }
      


      web.xml:
      <?xml version="1.0" encoding="UTF-8"?>
      <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
       version="2.5">
      
       <display-name>web-test</display-name>
      
       <servlet>
       <servlet-name>TestOneWeb</servlet-name>
       <servlet-class>com.ep.ff.web.endpoint.test.TestOneWeb</servlet-class>
       </servlet>
       <servlet-mapping>
       <servlet-name>TestOneWeb</servlet-name>
       <url-pattern>/ws/TestOne</url-pattern>
       </servlet-mapping>
      
       <servlet>
       <servlet-name>TestTwoWeb</servlet-name>
       <servlet-class>com.ep.ff.web.endpoint.test.TestTwoWeb</servlet-class>
       </servlet>
       <servlet-mapping>
       <servlet-name>TestTwoWeb</servlet-name>
       <url-pattern>/ws/TestTwo</url-pattern>
       </servlet-mapping>
      </web-app>
      


      http://localhost:8080/web-test/ws/TestOne?wsdl :
      <definitions name="TestOneWebService" targetNamespace="http://test.endpoint.web.ff.ep.com/"
      xmlns="http://schemas.xmlsoap.org/wsdl/"
      xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
      xmlns:tns="http://test.endpoint.web.ff.ep.com/"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema">
       <types>
       <xs:schema targetNamespace="http://test.endpoint.web.ff.ep.com/"
       version="1.0" xmlns:tns="http://test.endpoint.web.ff.ep.com/"
       xmlns:xs="http://www.w3.org/2001/XMLSchema">
       <xs:element name="methodOne" type="tns:methodOne"/>
       <xs:element name="methodOneResponse" type="tns:methodOneResponse"/>
       <xs:element name="methodTwo" type="tns:methodTwo"/>
       <xs:element name="methodTwoResponse" type="tns:methodTwoResponse"/>
       <xs:complexType name="methodOne">
       <xs:sequence>
       <xs:element minOccurs="0" name="arg0" type="xs:string"/>
       </xs:sequence>
       </xs:complexType>
       <xs:complexType name="methodOneResponse">
       <xs:sequence>
       <xs:element minOccurs="0" name="return" type="xs:int"/>
       </xs:sequence>
       </xs:complexType>
       <xs:complexType name="methodTwo">
       <xs:sequence>
       <xs:element minOccurs="0" name="arg0" type="xs:string"/>
       </xs:sequence>
       </xs:complexType>
       <xs:complexType name="methodTwoResponse">
       <xs:sequence>
       <xs:element minOccurs="0" name="return" type="xs:int"/>
       </xs:sequence>
       </xs:complexType>
       </xs:schema>
       </types>
       <message name="TestOneWeb_methodOne">
       <part element="tns:methodOne" name="methodOne"/>
       </message>
       <message name="TestOneWeb_methodTwo">
       <part element="tns:methodTwo" name="methodTwo"/>
       </message>
       <message name="TestOneWeb_methodOneResponse">
       <part element="tns:methodOneResponse" name="methodOneResponse"/>
       </message>
       <message name="TestOneWeb_methodTwoResponse">
       <part element="tns:methodTwoResponse" name="methodTwoResponse"/>
       </message>
       <portType name="TestOneWeb">
       <operation name="methodOne" parameterOrder="methodOne">
       <input message="tns:TestOneWeb_methodOne"/>
       <output message="tns:TestOneWeb_methodOneResponse"/>
       </operation>
       <operation name="methodTwo" parameterOrder="methodTwo">
       <input message="tns:TestOneWeb_methodTwo"/>
       <output message="tns:TestOneWeb_methodTwoResponse"/>
       </operation>
       </portType>
       <binding name="TestOneWebBinding" type="tns:TestOneWeb">
       <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
       <operation name="methodOne">
       <soap:operation soapAction=""/>
       <input>
       <soap:body use="literal"/>
       </input>
       <output>
       <soap:body use="literal"/>
       </output>
       </operation>
       <operation name="methodTwo">
       <soap:operation soapAction=""/>
       <input>
       <soap:body use="literal"/>
       </input>
       <output>
       <soap:body use="literal"/>
       </output>
       </operation>
       </binding>
       <service name="TestOneWebService">
       <port binding="tns:TestOneWebBinding" name="TestOneWebPort">
       <soap:address location="http://localhost:8080/web-test/ws/TestOne"/>
       </port>
       </service>
      </definitions>
      


      http://localhost:8080/web-test/ws/TestTwo?wsdl :
      <definitions name="TestTwoWebService" targetNamespace="http://test.endpoint.web.ff.ep.com/"
      xmlns="http://schemas.xmlsoap.org/wsdl/"
      xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
      xmlns:tns="http://test.endpoint.web.ff.ep.com/"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema">
       <types>
       <xs:schema targetNamespace="http://test.endpoint.web.ff.ep.com/"
       version="1.0" xmlns:tns="http://test.endpoint.web.ff.ep.com/"
       xmlns:xs="http://www.w3.org/2001/XMLSchema">
       <xs:element name="methodOne" type="tns:methodOne"/>
       <xs:element name="methodOneResponse" type="tns:methodOneResponse"/>
       <xs:element name="methodTwo" type="tns:methodTwo"/>
       <xs:element name="methodTwoResponse" type="tns:methodTwoResponse"/>
       <xs:complexType name="methodOne">
       <xs:sequence>
       <xs:element minOccurs="0" name="arg0" type="xs:string"/>
       </xs:sequence>
       </xs:complexType>
       <xs:complexType name="methodOneResponse">
       <xs:sequence>
       <xs:element minOccurs="0" name="return" type="xs:int"/>
       </xs:sequence>
       </xs:complexType>
       <xs:complexType name="methodTwo">
       <xs:sequence>
       <xs:element minOccurs="0" name="arg0" type="xs:string"/>
       </xs:sequence>
       </xs:complexType>
       <xs:complexType name="methodTwoResponse">
       <xs:sequence>
       <xs:element minOccurs="0" name="return" type="xs:int"/>
       </xs:sequence>
       </xs:complexType>
       </xs:schema>
       </types>
       <message name="TestTwoWeb_methodOne">
       <part element="tns:methodOne" name="methodOne"/>
       </message>
       <message name="TestTwoWeb_methodOneResponse">
       <part element="tns:methodOneResponse" name="methodOneResponse"/>
       </message>
       <message name="TestTwoWeb_methodTwo">
       <part element="tns:methodTwo" name="methodTwo"/>
       </message>
       <message name="TestTwoWeb_methodTwoResponse">
       <part element="tns:methodTwoResponse" name="methodTwoResponse"/>
       </message>
       <portType name="TestTwoWeb">
       <operation name="methodOne" parameterOrder="methodOne">
       <input message="tns:TestTwoWeb_methodOne"/>
       <output message="tns:TestTwoWeb_methodOneResponse"/>
       </operation>
       <operation name="methodTwo" parameterOrder="methodTwo">
       <input message="tns:TestTwoWeb_methodTwo"/>
       <output message="tns:TestTwoWeb_methodTwoResponse"/>
       </operation>
       </portType>
       <binding name="TestTwoWebBinding" type="tns:TestTwoWeb">
       <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
       <operation name="methodOne">
       <soap:operation soapAction=""/>
       <input>
       <soap:body use="literal"/>
       </input>
       <output>
       <soap:body use="literal"/>
       </output>
       </operation>
       <operation name="methodTwo">
       <soap:operation soapAction=""/>
       <input>
       <soap:body use="literal"/>
       </input>
       <output>
       <soap:body use="literal"/>
       </output>
       </operation>
       </binding>
       <service name="TestTwoWebService">
       <port binding="tns:TestTwoWebBinding" name="TestTwoWebPort">
       <soap:address location="http://localhost:8080/web-test/ws/TestTwo"/>
       </port>
       </service>
      </definitions>