【发布时间】:2019-02-02 11:17:55
【问题描述】:
我正在努力从 Python 2.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))
【问题讨论】:
标签: python python-2.7 magento soap zeep