【发布时间】:2018-02-15 11:21:48
【问题描述】:
我必须对单功能 SOAP Web 服务进行一些支持,但我无法理解 WSDL 文件的特定方面以及由 SoapUI 生成的 SOAP 请求。
此服务的 WSDL 在定义部分 (targetNamespace="tetra-river-common-types/trafficinfo") 中指定了一个 targetNamespace。
如果我将 WSDL 文件加载到 SoapUI 中,它会完美地读取所有内容;任何定义都没有问题。此服务的类型在单个外部模式文件中定义,在 WSDL 文件中具有以下定义:
<wsdl:types>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:import namespace="tetra-river-common-types" schemaLocation="tetra-river-interface.xsd" />
</xsd:schema>
</wsdl:types>
但是,在将 WSDL 文件加载到 SoapUI 中并打开自动生成的请求后,它会显示以下内容:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tet="tetra-river-common-types">
<soapenv:Header/>
<soapenv:Body>
<tet:TrafficInformation>
<tet:Item1>?</tet:Item1>
<!-- several other items with the tet: namespace prefixed -->
</tet:TrafficInformation>
</soapenv:Body>
</soapenv:Envelope>
我的问题是:tet: 命名空间是如何由 SoapUI 确定的?我在 WSDL 文件或 XSD 文件中都没有提到它。我假设它从 targetNamespace 获取前 3 个字符,但我不确定。
我面临的问题是 web 服务本身需要这个确切的消息,但 tetra: 作为命名空间。
【问题讨论】:
标签: soap xsd soapui xml-namespaces