【问题标题】:Is it possible to instruct Spring-WS to generate a WSDL containing wsdl:fault?是否可以指示 Spring-WS 生成包含 wsdl:fault 的 WSDL?
【发布时间】:2012-12-10 23:29:51
【问题描述】:

这是Spring forums 尚未回答的另一个问题。

我有一个带注释的端点,它抛出了一个用@SoapFault 注释的自定义异常

但是动态创建的 WSDL 不会在 wsdl:operation 中显示 wsdl:fault 也不存在该异常的 xs:elementName。

是否可以指示 Spring-WS 在操作中动态生成可选的故障元素?

谢谢。

【问题讨论】:

    标签: java spring wsdl spring-ws


    【解决方案1】:

    您是否在 [servlet-name]-servlet.xml 文件中定义了异常 xsd

    像这样 -

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

    您会在标记中看到异常 xsd。所以你必须定义它。

    看看这个tutorial

    查看上面链接中主题 XSD 中的第 1 部分链接。

    问候

    安舒尔卡塔

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-10-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多