I have a package with "logic" classes(like CheckAuthenticationDataLogic.java, GetVocabulariesLogic.java). And another class - ApiService.java is used to generate wsdl. ApiService.java is full of methods like this:
/**
* Check authentication data.
* @param contractNumber - number of contract.
* @param msisdn - msisdn.
* @param superPassword - super password.
* @return result of authentication.
*/
@WebMethod
@WebResult(name = "result")
public CheckAuthenticationDataResult checkAuthenticationData(@WebParam(name = "contractNumber")
final String contractNumber,
@WebParam(name = "msisdn")
final String msisdn,
@WebParam(name = "superPassword")
final String superPassword) {
return runLogic(new CheckAuthenticationDataLogic(contractNumber, msisdn, superPassword));
}
As you see it's just a proxy methods... So i want to avoid doing same work twice and generate WSDL right from logic classes without writing ApiService.java. Any tool or library for this purpose exists ?
The wsgen tool generates JAX-WS portable artifacts used in JAX-WS web services. Note that you do not have to generate WSDL at the development time as JAXWS runtime will automatically generate a WSDL for you when you deploy your service.
You might want to check the JAX-WS RI documentation and especially the samples (pay a special attention to the fromjava sample).
Axis2 is another alternative, specifically the java2wsdl command/plugin
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With