微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

无法过滤 Zeep 中的数据

如何解决无法过滤 Zeep 中的数据

我正在使用 Python(Zeep) 从 Salesforce 营销云 SOAP API 中提取数据。我能够连接并从中提取数据,但是我无法对其应用过滤器。谁能告诉我我在这里做错了什么?这是我要执行的代码

from zeep import wsdl         
from zeep.wsse.username import Usernametoken       
from zeep import Client      
client =Client("https://xxxx.soap.marketingcloudapis.com/etframework.wsdl",wsse=Usernametoken('username','password'))
requestDictionary = {
    "ObjectType": 'DataExtensionObject[xxx_WEB_FORM_DE]',"Properties": ['FirstName','LastName','LastModifiedDate'],"Filter": {'Property' : 'LastModifiedDate','SimpleOperator' : 'greaterThan','Value': '9/13/2020 6:37:00 PM'} 
}
response = client.service.Retrieve(RetrieveRequest=requestDictionary)
print(response)

-------------------------------------------------
Output:
**TypeError: {http://exacttarget.com/wsdl/partnerAPI}FilterPart() got an unexpected keyword argument 'Value'. Signature:**

xml 看起来像这样:

<sequence>
...
<element name="ObjectType" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<element name="Properties" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
<element name="Filter" type="tns:FilterPart" minOccurs="0" maxOccurs="1"/>
...
</sequence>
</complexType>

<complexType name="FilterPart"/>
<complexType name="SimpleFilterPart">
<complexContent>
<extension base="tns:FilterPart">
<sequence>
<element name="Property" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<element name="SimpleOperator" type="tns:SimpleOperators" minOccurs="1" maxOccurs="1"/>
<element name="Value" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
<element name="DateValue" type="xsd:dateTime" minOccurs="0" maxOccurs="unbounded"/>
</sequence>
</extension>
</complexContent>
</complexType>
<complexType name="TagFilterPart">

简单运算符:

<simpleType name="SimpleOperators">
<restriction base="xsd:string">
...
<enumeration value="notEquals"/>
<enumeration value="greaterThan"/>
<enumeration value="lessthan"/>
...
</restriction>
</simpleType>

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。