can we expose only required methods of EJB into Web service ?
deepa karkala
Ranch Hand
Joined: Jan 29, 2003
Posts: 62
posted
0
Hello web service experts, please help me. I have an session ejb having couple of methods out only selective methods need to be converted to web service.
I know that I can run java2wsdl, wsdl2java etc to convert an EJB to webservice. But all the methods will be exposed in web service.
Is there any way that only selective methods can be exposed as web service ? I wan to use Apache Axis tools java2wsdl and wsdl2java to conver EJB to web service.
Greately appreciate your valuable suggestion.
thanks
Deepa.
Amit ChaudhariC
Ranch Hand
Joined: Aug 06, 2009
Posts: 33
posted
0
You can specify what all methods to expose in the services.xml.
Regards,
Amit
shivendra tripathi
Ranch Hand
Joined: Aug 26, 2008
Posts: 263
posted
0
I am not sure if there is any flag using which you can select methods to be exposed as webservice in java2wsdl. But once WSDL is generated you can manually remove the methods you don't want to expose as webservice. Once you have edited WSDL as needed, run WSDL2java.
Shivendra, after dooing so much research in the web, even I got same thoughts . But my concern is, if I edit wsdl file, I am wondering should I modify any other generated files to ensure that all are in sync. In order to avoid this problem, I looked for any option that we may pass while running java2wsdl but I did not fine one.
But I am wondering this topic was not discussed anywhere in any site ( I did not find one). The tool java2wsdl is used when we already have EJB running in some application and we want to make use of its methods in some application or in some other machines. In most of the examples for java2wsdl, I see that existing EJB was considered to convert to Web service. But in every example, only one method is written in EJB which will not be the real case.
I hope some expert will get back to my question with proper solution (if I am lucky) :-).
thanks
deepa
shivendra tripathi
Ranch Hand
Joined: Aug 26, 2008
Posts: 263
posted
0
Deepa, If you are using AXIS2 then since WSDL will be only output so you don't need to worry about syncing.
Anyway if you don't want to edit your WSDL, good news is java2wsdl has flag "-m" to export only limited method to WSDL.