4

JAX-WS を使用して Java コードから WSDL を生成しようとしています。

WSDL での私の操作では、soapAction が空のままであることを除いて、すべてが正常に機能しているようです。

これが私のコードです:

@WebService
public class MyClass {
    public MyStuff queryStuff(String myParam) {
        return null;
    }
}

生成された WSDL には次のものが含まれます。

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

何が間違っているのかわかりません。何か案は?

4

1 に答える 1

7

メソッドに で注釈を付ける必要があります@WebMehtod

@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;
}

注:この例の注釈の多くは必須ではありませんが、JAX-WS でできるすべてのことを示すために注釈を入れました。

于 2012-07-13T08:38:36.170 に答える