• Post Reply Bookmark Topic Watch Topic
  • New Topic

How many WSDLs?

 
Ephraim Paka
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a service class with 15 methods, should I keep all methods in one class? or in different classes? In that case do I have to generate different wslds for each? How can a client invoke a method if there going to be different ports?
 
Mark D. Hansen
author
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure that I completely understand your question, but here is some explanation that might help. Respond back if you need more information.

JAX-WS, which is the standard for writing and consuming Web services in Java, maps a Java class to a single wsdl ort. Each public method gets mapped to a single wsdl peration on that port. That is the default behavior when you simply annotate the class with @WebService.

With WSDL, you can have multiple ports for each service. But, the JAX-WS mapping doesn't work that way. I.e., there is no way to bundle two classes and have them generate a single WSDL. The work around is to create a wrapper class that simply passes method invocations to the appropriate method on the appropriate class. Then use the wrapper class to generated your WSDL.

So, if you simply apply the @WebService annotation to your service class you'll get a single WSDL, with a single port, that has 15 operations. There is nothing wrong with that.
 
Ephraim Paka
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Mark,

I am using JAX-RPC1.1 , Websphere6.0 and EJB2.1, so notusing JAX-WS 2.0( wish I could), our comp doensot want to use ejb3.0 yet.
 
Mark D. Hansen
author
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK. Java -> WSDL mapping works the same way for JAX-RPC 1.1. Class maps to port. Method maps to operation.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!