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.
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!
Joined: Apr 20, 2006
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
Joined: Oct 04, 2006
OK, now I understand better!
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.
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.