如何在java中的webservice中添加SOAP动作?

Dev*_*per 5 java soap action

我正在研究SOAP Web服务.我使用了注释:@webService(endPointInterface =),@ WebMethod,@ WebResult.

Code :

<wsdl:operation name="thumbNailImageService">
<soap:operation soapAction="" style="document"/>
<wsdl:input name="thumbNailImageService">
<soap:body use="literal"/>
</wsdl:input>
Run Code Online (Sandbox Code Playgroud)

我正在获取上述请求的WSDL,但我的SOAP操作为null(空字符串).

我想从我的java代码中添加SOAP动作,就像任何一个注释一样.

需要的决议:

<soap:operation soapAction="Any Action URl points to service" style="document"/>
Run Code Online (Sandbox Code Playgroud)

帮助我使用Java代码使用注释添加SOAP操作.

我正在使用import或library,如下所示:

**import javax.jws.soap.SOAPBinding;
import javax.jws.soap.SOAPBinding.Style;
import javax.jws.soap.SOAPBinding.Use;
import javax.jws.WebService;
import javax.xml.bind.annotation.XmlRootElement;**
Run Code Online (Sandbox Code Playgroud)

谢谢

zel*_*ler 5

使用JAX-WS,您可以指定注释的action属性@WebMethod.它绑定到标记的action属性soap:operation.请参阅javadocs.