wsgen使用@WebMethod生成WSDL但忽略@WebParam

时间:2012-09-16 21:12:03

标签: java wsdl wsgen

我正在使用@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的问题并得到了相同的结果。

我错过了什么?

感谢。

1 个答案:

答案 0 :(得分:0)

@WebResult注释后,

向方法添加@WebMethod注释 和
制作@WebMethod(operationName = "jmsServiceInitialise")而非操作

相关问题