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) :-).
Joined: Aug 26, 2008
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.