Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generate WSDL from java class\source

Tags:

java

wsdl

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 ?

like image 598
Oleksandr Avatar asked Nov 03 '09 11:11

Oleksandr


2 Answers

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).

like image 69
Pascal Thivent Avatar answered Oct 25 '22 13:10

Pascal Thivent


Axis2 is another alternative, specifically the java2wsdl command/plugin

like image 39
puug Avatar answered Oct 25 '22 13:10

puug