Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add SOAP action to the webservice in java?

Tags:

java

soap

action

I am working on the SOAP webservice. I have used the annotation like : @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 am getting WSDL for the above request,But my SOAP action is null(blank string).

I want to add SOAP action from my java code like any of the annotation.

Resolution needed :

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

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

I am using import or library for it as 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

like image 565
Developer Avatar asked Jan 01 '12 19:01

Developer


1 Answers

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

like image 154
zeller Avatar answered Oct 05 '22 04:10

zeller