Python 使用Zeep过滤Magento SOAP请求

Python 使用Zeep过滤Magento SOAP请求,python,python-2.7,magento,soap,zeep,Python,Python 2.7,Magento,Soap,Zeep,我正在努力从Python2.7向Magento的SOAP服务发送一个过滤器。我正在尝试使用Zeep包调用SOAP服务。发送一个空列表作为第二个参数可以很好地返回所有数据。然而,当我在第二个参数中设置一个过滤器时,它被忽略,我仍然得到所有的数据。提前谢谢 from zeep import Client client = Client('https://mywebsite.com/api/v2_soap/index/?wsdl=1') token = client.service.login('

我正在努力从Python2.7向Magento的SOAP服务发送一个过滤器。我正在尝试使用Zeep包调用SOAP服务。发送一个空列表作为第二个参数可以很好地返回所有数据。然而,当我在第二个参数中设置一个过滤器时,它被忽略,我仍然得到所有的数据。提前谢谢

from zeep import Client

client = Client('https://mywebsite.com/api/v2_soap/index/?wsdl=1')

token = client.service.login('myusername', 'mypassword')

# This works fine, returns all of the customers
customer_list = client.service.customerCustomerList(token, [])

# This still returns all of the customers and ignores the filter
filter = [{'created_at': {'from': '2018-07-01 00:00:00'}}]
customer_list_filtered = client.service.customerCustomerList(token, filter)
我不确定这是否相关,但我收到了这些警告

C:\Users\some_path_to_python\lib\site-packages\zeep\wsdl\wsdl.py:335: UserWarning: The wsdl:message for u'{urn:Magento}channelintegrationOrderInfoResponse' contains an invalid part ('result'): invalid xsd type or elements
  warnings.warn(str(exc))
C:\Users\some_path_to_python\lib\site-packages\zeep\wsdl\definitions.py:130: UserWarning: The wsdl:operation 'channelintegrationOrderInfo' was not found in the wsdl:portType u'{urn:Magento}PortType'
  warnings.warn(str(exc))

在我的例子中,我必须正确设置过滤器的格式。按照文档中的示例,我必须编写这样的过滤器

过滤器=[{
“过滤器”:{
“complexObjectArray”:[{
“键”:“状态”,
“值”:“挂起”
}]
},
“复合过滤器”:{
“complexObjectArray”:[{
“键”:“状态”,
“价值”:{
“key”:“in”,
“值”:“挂起,正在处理”
}
}]
}
}]
换句话说,用complexObjectArray包装所有内容以使其正常工作