[jboss-user] [JBossWS] - Two webservice classes define method with same name (bug?)

gbdt do-not-reply at jboss.com
Sun Aug 26 10:57:30 EDT 2007


Hi,
I have a test case in which I get wrong WSDLs:
(Both classes are in the same package)

File1:

  | package com.XXXX;
  | 
  | import javax.ejb.Stateless;
  | import javax.jws.WebMethod;
  | import javax.jws.WebParam;
  | import javax.jws.WebService;
  | 
  | @WebService
  | @Stateless
  | public class TestClass1 {
  | 
  | 	@WebMethod
  | 	public ****Integer**** method(@WebParam(name="f")Float f) {
  | 		return null;
  | 	}
  | }
  | 

File2:

  | package com.XXXX;
  | 
  | import javax.ejb.Stateless;
  | import javax.jws.WebMethod;
  | import javax.jws.WebParam;
  | import javax.jws.WebService;
  | 
  | @WebService
  | @Stateless
  | public class TestClass2 {
  | 
  | 	@WebMethod
  | 	public ****Double**** method(@WebParam(name="f")Float f) {
  | 		return 17.0;
  | 	}
  | }
  | 

The problem is that for both services the WSDL definition of the return type is xs:int, while for the second class it should be a double.

For TestClass1:

  | <types>
  | <xs:schema targetNamespace="http://XXXX.com/" version="1.0" xmlns:tns="http://XXXX.com/" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  |   <xs:element name="method" type="tns:method" /> 
  |   <xs:element name="methodResponse" type="tns:methodResponse" /> 
  |  <xs:complexType name="method">
  |  <xs:sequence>
  |   <xs:element minOccurs="0" name="f" type="xs:float" /> 
  |   </xs:sequence>
  |   </xs:complexType>
  |  <xs:complexType name="methodResponse">
  |  <xs:sequence>
  |   <xs:element minOccurs="0" name="return" type="****xs:int****" /> 
  |   </xs:sequence>
  |   </xs:complexType>
  |   </xs:schema>
  |   </types>
  | 

And for TestClass2:

  | ...
  |  <types>
  |  <xs:schema targetNamespace="http://XXXX.com/" version="1.0" xmlns:tns="http://XXXX.com/" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  |   <xs:element name="method" type="tns:method" /> 
  |   <xs:element name="methodResponse" type="tns:methodResponse" /> 
  |  <xs:complexType name="method">
  |  <xs:sequence>
  |   <xs:element minOccurs="0" name="f" type="xs:float" /> 
  |   </xs:sequence>
  |   </xs:complexType>
  |  <xs:complexType name="methodResponse">
  |  <xs:sequence>
  |   <xs:element minOccurs="0" name="return" type="****xs:int****" /> 
  |   </xs:sequence>
  |   </xs:complexType>
  |   </xs:schema>
  |   </types>
  | ...
  | 

The second method definition, for a totally different service has an incorrect return type.

Is is a bug or some kind of error on my side?

Thanks!

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4078139#4078139

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4078139



More information about the jboss-user mailing list