本文介绍了有没有办法在 Spring WS 2 中公开静态 XSD?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果,例如 orders.wsdl 导入 Orders.xsd,如何使用 static-wsdl 进行配置

If, for example orders.wsdl imports Orders.xsd, how can it be configured using static-wsdl

<sws:static-wsdl id="orders" location="/WEB-INF/wsdl/orders.wsdl"/>

这样可以在浏览器中查看 Orders.xsd,如 http://host/context/Orders.xsd

such that Orders.xsd can be viewed in the browser like http://host/context/Orders.xsd

动态 wsdl 支持它.

Dynamic wsdl supports it.

<sws:dynamic-wsdl id="orders"
    portTypeName="Orders"
    locationUri="http://localhost:8080/ordersService/">
  <sws:xsd location="/WEB-INF/xsd/Orders.xsd"/>
</sws:dynamic-wsdl>

但是 static-wsdl 没有 sws:xsd 属性.

But static-wsdl doesn't have the sws:xsd property.

推荐答案

没有 namspace 支持,但你可以这样做 -

There is no namspace support but you can do this -

<bean id="Orders" class="org.springframework.xml.xsd.SimpleXsdSchema">
    <property name="xsd" value="classpath:/Orders.xsd" />
</bean>

这将解析 wsdl 文件中引用的 xsd -

This will resolve the referenced xsd in your wsdl file -

<wsdl:types>
    <xsd:schema elementFormDefault="qualified">
        <xsd:import namespace="..." schemaLocation="Orders.xsd"></xsd:import>
    </xsd:schema>
</wsdl:types>

这篇关于有没有办法在 Spring WS 2 中公开静态 XSD?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-25 00:18