This week's giveaways are in the MongoDB and Jobs Discussion forums.
We're giving away four copies of Mongo DB Applied Patterns and 4 resume reviews from Five Year Itch and have the authors/reps on-line!
See this thread and this one for details.
The moose likes Web Services and the fly likes One Web Service offers Two Clients Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Mongo DB Applied Patterns this week in the MongoDB forum
or a resume review from Five Year Itch in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Web Services
Reply Bookmark "One Web Service offers Two Clients" Watch "One Web Service offers Two Clients" New topic
Author

One Web Service offers Two Clients

carlos Muller
Greenhorn

Joined: Apr 20, 2006
Posts: 14
Hello everybody, I've a problem. I want to make an Eclipse Ganimede project with one webservice inside, I'm using Axis 1.6.5. I want this webservice offers two differents funcionalities, but one funcionality depends of the other one, and all them use three common VO. That is:

ObjectA methodServer1(ObjectB, Objetc C); -> In one class of the project webservice, I want to use it one kind of client.
ObjectB methodServer2(Objetc A); -> In another class of the project webservice, I want to use it another kind of client. This method use inside the methodServer1.

My question is: How do you make this idea? With 2 differents WSDL in the same server project? Or 1! WSDL with the two differents definitions of funcionalities inside? Any problem with the common Objects for the two differents clients?

Thanks very munch to all and sorry for my english. If you know a good book or tutorial with this information inside (1 server - 2 clients), please tell to me.

Carlos Muller
Ivan Krizsan
Bartender

Joined: Oct 04, 2006
Posts: 2193
Hi!
I must admit that I do not totally understand your question, but I will give it a try anyway:

You can expose the two methods that you implement in an endpoint implementation class. This class does not contain any business logic, but delegates to a delegate class that implements the business logic of the two methods. The methodServer2 method in the delegate is free to call methodServer1 on itself, as a part of its implementation. It can do so without taking the detour over web services.
If this is what you want, then I see no reason to use more than one WSDL.
If this is not what you meant, please clarify if you want me to give it another go!
Best wishes!
carlos Muller
Greenhorn

Joined: Apr 20, 2006
Posts: 14
Thank you very munch Ivan, but my desire is to generate two differents clients of the web service; one with the posibility of research the methodServer1() (and restricted the methodServer2()); and other one with the posibility of research the methodServer2()... Both methods in the same eclipse project; the same WS server; but we would can give one client (generate with one wsdl) to the user; or give another client (generate with another wsdl) depending on the kind of user of our WS.

Thanks for all
Ivan Krizsan
Bartender

Joined: Oct 04, 2006
Posts: 2193
Hello!
OK, now I understand better!
Option 1:
Still use the delegate that implements the functionality of the both methods, but implement two different endpoint classes that delegate to one and the same delegate. I just tested this approach and, when deployed, such an application will indeed generate two different WSDL files - one for each endpoint class (annotated with @WebService). I suspect this is the easiest option.

Option 2:
You can also hand-write two WSDL files to only expose certain method(s) of one and the same endpoint implementation class.
In this case, you will also have to write the webservice.xml and any container-specific deployment descriptors that requires being written.

Best wishes!
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: One Web Service offers Two Clients
 
Similar Threads
JPQL - Query Parameter
Steps for creating Remote Java WebServices in eclipse
Webservice using Websphere
RMI delivery
axis2. xsi:type object mapping does not work