简体   繁体   English

如何使用suds通过__encoded_query进行过滤?

[英]How to filter by __encoded_query using suds?

How can I filter results with __encoded_query using SUDS api? 如何使用SUDS API使用__encoded_query过滤结果?

I have it, but doesnt work: 我有它,但是不起作用:

client = Client(WSDL_URL, username=USERNAME, password=PASSWORD)
records = client.service.getRecords(__limit = 100, __encoded_query='incident_state=3')

One way to filter results is using __inject: 一种过滤结果的方法是使用__inject:

   msg = \
          """<?xml version="1.0" encoding="UTF-8"?>
          <SOAP-ENV:Envelope xmlns:ns0="http://www.service-now.com/incident" 
              xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/" 
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
              xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
          <SOAP-ENV:Header/>
              <ns1:Body>
                  <ns0:getRecords>
                      <ns0:__encoded_query>status=0</ns0:__encoded_query>
                  </ns0:getRecords>
              </ns1:Body>
          </SOAP-ENV:Envelope>
            """

    records = client.service.getRecords(__inject = {'msg' : msg})

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

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