Empty soapAction in generated WSDL

java, jax-ws, soap, web-services

Solution

You need to annotate your method with `@WebMehtod`.

Example

@WebService(name = "dataService", targetNamespace = "http://example.com/vap/webservice/dataservice/definition")
@SOAPBinding(style = Style.DOCUMENT, use = Use.LITERAL, parameterStyle = ParameterStyle.WRAPPED)
public interface DataSEI {

    @WebMethod(action = "createAction", operationName = "create")
    DataTransferObjectStatusContainer create(
            @WebParam(name = "objects", targetNamespace = "http://example.com/vap/webservice/dataservice/definition")
            DataTranferObjectContainer pObjectsContainer,
            @WebParam(name = "atomic", targetNamespace = "http://example.com/vap/webservice/dataservice/definition")
            boolean pAsAtomicOperation) throws Fault;
}

NOTE: A lot of the annotations from the example are not required, but I put it there to show you all the things you can do with JAX-WS

Problem

I'm trying to generate a WSDL from my Java code using JAX-WS. Everything seems to work OK, except that for my operations in the WSDL the soapAction remains empty. Here is my code: ``` @WebService public class MyClass { public MyStuff queryStuff(String myParam) { return null; } } ``` The generated WSDL contains this: ``` <wsdl:operation name="queryStuff"> <wsdlsoap:operation soapAction=""/> <wsdl:input name="queryStuffRequest"> <wsdlsoap:body use="literal"/> </wsdl:input> <wsdl:output name="queryStuffResponse"> <wsdlsoap:body use="literal"/> </wsdl:output> </wsdl:operation> ``` I can't tell what I'm doing wrong. Any ideas?

Original source