本文介绍了从java class\source生成WSDL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含逻辑类的包(比如CheckAuthenticationDataLogic.java,GetVocabularyiesLogic.java)。另一个类--ApiService.java用于生成wsdl。
ApiService.java包含以下方法:

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));
  }

如你所见它只是一种代理方法......所以我想避免两次做同样的工作并直接从逻辑类生成WSDL而无需编写ApiService.java。
是否存在用于此目的的任何工具或库?

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 ?

推荐答案

工具生成JAX-WS Web服务中使用的JAX-WS可移植工件。请注意,您不必在开发时生成WSDL,因为JAXWS运行时将在您部署服务时自动为您生成WSDL。

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.

您可能想检查JAX-WS RI ,尤其是(特别注意 fromjava 样本)。

You might want to check the JAX-WS RI documentation and especially the samples (pay a special attention to the fromjava sample).

这篇关于从java class\source生成WSDL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-25 00:41