根据标准,以下 SOAP 请求是否有效?
<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<ns2:ServiceReq xmlns:ns2="http://www.tibco.com/service" xmlns:ns1="http://www.tibco.com/framework">
<ns1:HeaderIn>
<ns1:countryISO>FR</ns1:countryISO>
<ns1:callerDateTime>2021-11-26T15:50:08.742Z</ns1:callerDateTime>
</ns1:HeaderIn>
<ns2:request>
<entete>
<profile>Default</profile>
</entete>
<input>
<type>W</type>
<codeRegion>X</codeRegion>
</input>
</ns2:request>
</ns2:ServiceReq>
</soapenv:Body>
</soapenv:Envelope>
我不确定,因为某些标签没有命名空间
最佳答案
这里有多个级别的有效:
SOAP 消息正文中的所有元素都应该属于特定的命名空间,但有时开发人员会忘记在元素上添加命名空间注释,或者从其他地方复制粘贴某些内容,或者其他任何内容,最终会出现奇怪的外观像这样的 XML。该服务有效并且消息被正确解析,但它看起来很有趣。
关于带有特定标签但没有命名空间的 SOAP 请求,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70128020/