简体   繁体   English

是否可以指示Spring-WS生成包含wsdl:fault的WSDL?

[英]Is it possible to instruct Spring-WS to generate a WSDL containing wsdl:fault?

Here is another question that hasn't been answered at Spring forums yet. 这是Spring论坛上尚未回答的另一个问题。

I have an annotated endpoint that throws a custom exception that it's annotated with @SoapFault 我有一个带注释的终结点,它引发了一个自定义异常,该异常用@SoapFault进行了注释

But the WSDL, that is created dynamically, doesn't show a wsdl:fault in the wsdl:operation neither exists an xs:elementName for that exception. 但是,动态创建的WSDL在wsdl:operation中没有显示wsdl:fault,也不存在该异常的xs:elementName。

Is it possible to instruct Spring-WS to dynamically generated the optional fault elements within the operations? 是否可以指示Spring-WS在操作中动态生成可选的故障元素?

Thanks. 谢谢。

Have you defined the exception xsd in the [servlet-name]-servlet.xml file 您是否在[servlet-name] -servlet.xml文件中定义了异常xsd

Like this - 像这样 -

<sws:dynamic-wsdl id="user" portTypeName="User"
        locationUri="/userService/" targetNamespace="http://test.nl/wsdls/userservice/2011/04">
        <sws:xsd location="classpath:/exception.xsd" />
        <sws:xsd location="classpath:/base.xsd" />
        <sws:xsd location="classpath:/user.xsd" />
        <sws:xsd location="classpath:/userservice.xsd" />
    </sws:dynamic-wsdl>

You see the exception xsd is there in the tag. 您会看到标记中存在xsd异常。 So you have to define it. 因此,您必须对其进行定义。

Take a look at this tutorial 看一下本教程

look at the Part1 link in topic XSD in above link. 在上面的链接中,查看主题XSD中的Part1链接。

Regards 问候

Anshul Katta 安舒尔·卡塔(Anshul Katta)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM