Soap 为什么一个wsdl有不同的请求定义
在项目开始时,客户机向我提供了一个WSDL,我最终使用SOAP UI为给定的WSDL创建了一个请求和响应对象,其中请求对象如下所示:Soap 为什么一个wsdl有不同的请求定义,soap,wsdl,Soap,Wsdl,在项目开始时,客户机向我提供了一个WSDL,我最终使用SOAP UI为给定的WSDL创建了一个请求和响应对象,其中请求对象如下所示: <soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:def="http://DefaultNamespace">
<soapenv:Header/>
<soapenv:Body>
<def:someOperation soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<in0 xsi:type="soapenc:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">SOME_DATA</in0>
</def:someOperation>
</soapenv:Body>
</soapenv:Envelope>
但是,当来自同一wsdl的生产环境的实际请求是
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<someOperation xmlns="urn:SOMEService">
<in0>SOME_DATA</in0>
</someOperation>
</soap:Body>
</soap:Envelope>
如果您观察到名称空间是相同的,但它确实与第一个请求中的名称不同
它与第一个请求中的名称确实有区别。谢谢您的回复,理解它很有帮助:但这是否意味着SOAP ui会生成更多的一般请求?与wsdl中提供的某些服务类似,SOAP UI在开发来自的请求时不包括它wsdl@tyro很高兴知道它有帮助,我在SOAP-UI方面的经验较少,所以不确定它是否忽略了xml前缀,在您的例子中,我看到,您说过,它有由SOAP-UI生成的DefaultNamespace。Xmls结构在定义名称空间的位置上是灵活的,可以在根节点、节点上或everynode上立即定义名称空间,但如果定义正确,在所有情况下它可能具有完全相同的含义,请参见此处的示例
<def:someOperation soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<in0 xsi:type="soapenc:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">SOME_DATA</in0>
</def:someOperation>
<someOperation xmlns="urn:SOMEService">
<in0>SOME_DATA</in0>
</someOperation>