我在 SOAP UI 中构建了一个运行良好的查询:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:CHG_ChangeInterface_WS">
<soapenv:Header>
<urn:AuthenticationInfo>
<urn:userName></urn:userName>
<urn:password></urn:password>
<!--Optional:-->
<urn:authentication>?</urn:authentication>
<!--Optional:-->
<urn:locale>?</urn:locale>
<!--Optional:-->
<urn:timeZone>?</urn:timeZone>
</urn:AuthenticationInfo>
</soapenv:Header>
<soapenv:Body>
<urn:Change_QueryList_Service>
<urn:Qualification>('Change Request Status'!="Closed" AND 'Change Request Status'!="Cancelled") AND 'Scheduled Start Date'>"2019-04-22" AND 'Scheduled End Date'<"2019-05-06" </urn:Qualification>
<urn:startRecord>1</urn:startRecord>
<urn:maxLimit>10</urn:maxLimit>
</urn:Change_QueryList_Service>
</soapenv:Body>
</soapenv:Envelope>
当我通过我的 C# 代码进行同样的调用时,这工作正常,我得到了我的预期结果:
var response = service.Change_QueryList_Service("'Scheduled Start Date' > \"2019-04-22\"", "1", "1000").ToList();
当我修改该调用以包含一些范围时,就像我在 SOAP UI 示例中所做的那样,它无法抱怨 XML(我得到了):
var response = service.Change_QueryList_Service("'Scheduled Start Date' >= \"2019-04-22\" AND 'Scheduled End Date' < \"2019-05-06\"", "1", "1").ToList();
我尝试转义“小于”字符,但这也失败了(抱怨限定行字符 66,这是转义序列的开始位置:
var response = service.Change_QueryList_Service("'Scheduled Start Date' >= \"2019-04-22\" AND 'Scheduled End Date' < \"2019-05-06\"", "1", "1").ToList();
任何帮助,将不胜感激。谢谢!