【发布时间】:2012-09-17 05:22:50
【问题描述】:
我正在使用 @WebService、@WebMethod 和 @WebParam 注释从 Java 类生成 WSDL。 WSDL 已生成,并包括@WebService 和@WebMethod 的输出,但@WebParam 注释似乎被忽略了。
这是一个解决此问题的方法声明:
@WebMethod(action = "jmsServiceInitialise")
public boolean jmsServiceInitialise(
@WebParam(name = "queue") String queueName,
@WebParam(name = "channel") String channel,
@WebParam(name = "hostname") String hostName,
@WebParam(name = "port") String port,
@WebParam(name = "requiresresponse") boolean requiresResponse) {
log.info("jmsServiceInitialise " + queueName + ": started");
// etc
return returnValue;
}
WSDL 文件没有提及任何参数,但方法是存在的。该方法可以作为web服务调用,但是String参数值都是null。
我最初在 Eclipse 中遇到了这个问题,但后来在命令行(Windows,JAX-WS RI 2.2.4-b01)复制了 wsgen 的问题并得到了相同的结果。
我错过了什么?
谢谢。
【问题讨论】: