[英]wsgen generating WSDL using @WebMethod but ignoring @WebParam
I'm generating a WSDL from a Java class using the @WebService
, @WebMethod
and @WebParam
annotations. 我正在使用@
@WebService
,@ @WebMethod
和@WebParam
批注从Java类生成WSDL。 The WSDL is generated, and includes output for @WebService
and @WebMethod
, but the @WebParam
annotations appear to be ignored. WSDL已生成,并且包含
@WebService
和@WebMethod
输出,但是@WebParam
注释似乎被忽略了。
Here's one method declaration with this problem: 这是一个存在此问题的方法声明:
@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;
}
The WSDL file contains no mention of any of the parameters, but the method is there. WSDL文件不包含任何参数,但是方法在那里。 The method can be called as a web service, but the String parameter values are all
null
. 该方法可以称为Web服务,但String参数值均为
null
。
I originally encountered this problem in Eclipse, but have since replicated the problem with wsgen at the command line (Windows, JAX-WS RI 2.2.4-b01) and get the same result. 我最初在Eclipse中遇到此问题,但此后在命令行(Windows,JAX-WS RI 2.2.4-b01)上用wsgen复制了该问题,并获得了相同的结果。
What am I missing? 我想念什么?
Thanks. 谢谢。
add @WebResult
annotation to method, after @WebMethod
annotation 在
@WebMethod
注释之后,将@WebResult
注释添加到方法
and 和
make @WebMethod(operationName = "jmsServiceInitialise")
instead of action 使用
@WebMethod(operationName = "jmsServiceInitialise")
代替操作
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.