2012-09-16 39 views
1

我使用@WebService@WebMethod@WebParam註釋從Java類生成WSDL。生成WSDL,幷包括@WebService@WebMethod的輸出,但@WebParam註釋似乎被忽略。wsgen使用@WebMethod生成WSDL,但忽略@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複製了這個問題,並得到了相同的結果。

我錯過了什麼?

謝謝。

回答

0

添加@WebResult註釋方法,後@WebMethod註釋

使@WebMethod(operationName = "jmsServiceInitialise"),而不是行動