我们将代理服务的一个版本存储在 WSDL 文档中——到元素 /definitions/documentation 中:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns="http://mynamespace.cz/1.0"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
name="MyService" targetNamespace="ttp://mynamespace.cz/1.0">
<wsdl:documentation>
<version>2.0</version>
</wsdl:documentation>
我可以将服务部署到服务总线 12c (12.2.1) 并且服务运行良好。当我从服务总线控制台(所谓的资源 WSDL)显示 WSDL 时,WSDL 符合我的预期,包括:
<wsdl:documentation>
<version>2.0</version>
</wsdl:documentation>
但是,如果我通过 URL 获得有效的 WSDL(由服务总线从资源 WSDL 创建): http://myserver:port/sbresource?PROXY/MyService/MyService
元素文档被覆盖:
<WL5G3N0:documentation>
2.0
</WL5G3N0:documentation>
元素版本完全丢失,但它的内容仍然存在。
您能否告知为什么会发生这种情况以及是否有任何解决方法?我们需要保留元素“版本”,以便解析器能够检索服务版本。
我的目标是为服务消费者提供一个易于使用的解决方案,即有一个单一的 WSDL 作为信息源,并让 WSDL 尽可能简单以便被 XPath 解析。