我在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();
任何帮助将不胜感激。谢谢!
答案 0 :(得分:0)
像第一个示例一样,尝试在第三个参数上设置1000。 同样在“补救措施”文档中,字段名称以下划线而不是空格显示:
Sheduled_Start_Date