首页 文章

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

提问于
浏览
1

我正在使用 @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

    @WebMethod 注释之后,向方法添加 @WebResult 注释

    make @WebMethod(operationName = "jmsServiceInitialise") 而不是行动

相关问题