How to add SOAP action in webservice in java?

I am working on a SOAP web service. I used the annotation, for example: @webService (endPointInterface =), @WebMethod, @WebResult.

Code : <wsdl:operation name="thumbNailImageService"> <soap:operation soapAction="" style="document"/> <wsdl:input name="thumbNailImageService"> <soap:body use="literal"/> </wsdl:input> 

I get the WSDL for the above request, but my SOAP action is null (empty string).

I want to add a SOAP action from my java code, like any of the annotations.

Required Permission:

 <soap:operation soapAction="Any Action URl points to service" style="document"/> 

Help me using java code to add a SOAP action using annotation.

I use an import or library for it, as shown below:

 **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;** 

thanks

+4
source share
1 answer

With JAX-WS, you can specify the action attribute of @WebMethod annotations. It binds to the action attribute of the soap:operation tag. See javadocs .

+4
source

Source: https://habr.com/ru/post/1388829/


All Articles