aspose file tools
The moose likes Web Services and the fly likes Same method in two classes - conflict? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Web Services
Reply Bookmark "Same method in two classes - conflict?" Watch "Same method in two classes - conflict?" New topic
Author

Same method in two classes - conflict?

David Balažic
Ranch Hand

Joined: May 15, 2008
Posts: 83
Hi!

I work on a larger project that involves also web services.
Recently a problem surfaced-

The generated WSDL has a wrong signature for one method. It seems it is due to another method in anothe class that has the same name.

The project is built by maven, by the way.

Code details:


After building (no error reported) and deploying (to tomcat 6.0.20),
if I open the ?wdsl URL in Firefox and the ?xsd=1 URL,
I see that both methods/operations are declared as having two parameters.
In log there is a (single) line:
INFO: Dynamically creating request wrapper Class com.example.ws.jaxws.DoStuffWS

Does this mean there is some kind of name conflict?
They are two different web services, but it seems they somehow use the same namespace for the generated parameter class.

Funny thing is, this somehow worked until today.

Also if I rename one of these methods (and the operation name), then it works.
(but then I would have to adapt the rest of the project to this change)

Help appreciated.

Version info:
- maven v1.1 (yes, I know)
- Eclipse v3.5.0 (just for editing and SVN handling)
- tomcat 6.0.20
- JAX-WS RI 2.1.4-b01-

Regards,
David
Ivan Krizsan
Bartender

Joined: Oct 04, 2006
Posts: 2193
Hi!
Are both the operations (that have the same name) located in the same <portType> in the WSDL?
If that is the case, then this is not a recommended approach according to the WS-I Basic Profile 1.1:

R2304 A wsdl:portType in a DESCRIPTION MUST have operations with distinct values for their name attributes.

Can't you rename one of the operations using the @WebMethod annotation?
Best wishes!
David Balažic
Ranch Hand

Joined: May 15, 2008
Posts: 83
Ivan Krizsan wrote:Hi!
Are both the operations (that have the same name) located in the same <portType> in the WSDL?

I will look later (I am on different PC now).
I do remember that they are in two separate WSDLs.
Each has a different URL. Like:
http://localhost:8080/ExampleXXWS?wsdl
and
http://localhost:8080/ExampleWS?wsdl
David Balažic
Ranch Hand

Joined: May 15, 2008
Posts: 83
OK here is the exact data.
The two are on different URLs, like:
http://localhost:8080/foo/ExampleXXWSService?wsdl
and
http://localhost:8080/foo/ExampleWSService?wsdl

And they both have a portType with different names ("ExampleXXWS" and "ExampleWS")
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Same method in two classes - conflict?
 
Similar Threads
Webservice method not getting executed.
customizing EJB3 webservice response types?
Service for Asynchronous Client calls (polling, callback)
using webservice
WebParam annotation.