Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Same method in two classes - conflict?

 
David Balažic
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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")
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!