我需要实现一个SPML接口,它最终通过 HTTP(s) 执行 SOAP 请求。我有一个 wsdl 可以归结为:
<wsdl:types>
<schema targetNamespace="http://soapadapter.something" xmlns="http://www.w3.org/2001/XMLSchema">
<element name="receiveRequest" type="xsd:anyType"/>
</schema>
</wsdl:types>
[...]
<wsdl:operation name="receiveRequest">
<wsdl:input message="impl:receiveRequestRequest" name="receiveRequestRequest"/>
</wsdl:operation>
如您所见,唯一定义的请求元素是“xsd:anyType”类型。我有一个单独的 xsd,在 wsdl 中根本没有链接,它描述了应该如何形成请求。
我想使用 zeep 来实现一个 SOAP 请求来使用接口。我怎样才能让 zeep 知道那个(本地)xsd 文件?
我找到了这个zeep.xsd.schema.SchemaDocument
类,但没有任何地方使用它的例子。有人可以给我一个使用示例,说明如何创建使用 wsdl 和单独 xsd 文件的客户端吗?