生成的WSDL中的空soapAction [英] Empty soapAction in generated WSDL

查看:820
本文介绍了生成的WSDL中的空soapAction的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用JAX-WS从我的Java代码生成WSDL。

I'm trying to generate a WSDL from my Java code using JAX-WS.

除了我在WSDL中的操作之外,一切似乎都正常工作soapAction仍为空。

Everything seems to work OK, except that for my operations in the WSDL the soapAction remains empty.

这是我的代码:

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

我不知道我做错了什么。有什么想法?

I can't tell what I'm doing wrong. Any ideas?

推荐答案

你需要用 @WebMehtod 注释你的方法。

You need to annotate your method with @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做的所有事情

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

这篇关于生成的WSDL中的空soapAction的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆