• Post Reply Bookmark Topic Watch Topic
  • New Topic

can we expose only required methods of EJB into Web service ?

 
deepa karkala
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can specify what all methods to expose in the services.xml.

Regards,
Amit
 
shivendra tripathi
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
deepa karkala
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Amit and Shivenra.

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
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Refer this for more info http://ws.apache.org/axis/java/reference.html#Java2WSDLReference

-Shiv
 
deepa karkala
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wow ! that's great. Thank you very much Shivendra. I am lucky today :-).

thanks
deepa
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!