简体   繁体   English

忽略python suds soap客户端中的未知属性

[英]Ignore unknown properties in python suds soap client

How do i configure python suds client to ignore unknown properties in a SOAP response that are not present in the wsdl? 如何配置python suds客户端以忽略wsdl中不存在的SOAP响应中的未知属性?

For example, if the input wsdl contains an object like this 例如,如果输入wsdl包含这样的对象

  <complexType name="VolCreateAttr">
   <sequence>
     <element name="name" type="xsd:string" minOccurs="1" maxOccurs="1"/>
     <element name="description" type="xsd:string" minOccurs="1" maxOccurs="1"/>
     <element name="size" type="xsd:unsignedLong" minOccurs="1" maxOccurs="1"/>
   </sequence>
  </complexType>

and i make a SOAP call getVolInfo that returns an object of the above type. 我进行了SOAP调用getVolInfo,该方法返回上述类型的对象。 But the response has an extra property called "reserve" in addition to the 3 properties mentioned in the wsdl. 但是,除了wsdl中提到的3个属性外,响应还具有一个称为“ reserve”的额外属性。 Currently suds throw a Type not found error. 目前,肥皂水会引发“ 找不到类型”错误。 How do i configure suds to ignore unknown properties in the response 如何配置肥皂水以忽略响应中的未知属性

I think there are basically two options which are about either tweaking the WSDL so it matches the real return values or removing the extra elements directly from the output: 我认为基本上有两个选项可以调整WSDL,使其与实际返回值匹配,或者直接从输出中删除多余的元素:

Alternatively you could use a different SOAP library which generates code from a WSDL and tweak that code by hand. 或者,您可以使用其他SOAP库,该库从WSDL生成代码并手动调整该代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM