我正在尝试使用PHP发出SOAP请求。
使用以下参数我收到此错误:
$soapURL = 'http://my.simpleviewcrm.com/webapi/listings/soap/listings.cfc?wsdl';
$client = new SoapClient($soapURL, array('trace' => true));
$listingRequest = array(
'username' => 'someuser',
'password' => 'somepass',
'pagenum' => 15,
'pagesize' => 10,
'filters' => array(
'FieldCategory' => 'Listing',
'FieldName' => 'Listingid',
'FilterType' => 'Equal To',
'FilterValue' => 13,
),
'displayamentities' => 1
);
$listingResponse = $client->__soapCall("getListings", $listingRequest);
//echo 'Request: ' . $client->__getLastRequest() .'';
echo "</br><h3>Listing Response</h3>";
print '<pre>';
var_dump($listingResponse);
print '</pre>';
输出:
array(2) {
["DATA"]=>
array(0) {
}
["STATUS"]=>
array(3) {
["RESULTS"]=>
string(1) "0"
["ERRORS"]=>
array(1) {
[0]=>
array(3) {
["MESSAGE"]=>
string(44) "Element FILTERS is undefined in FILTERGROUP."
["DETAIL"]=>
string(0) ""
["TYPE"]=>
string(10) "Expression"
}
}
["HASERRORS"]=>
string(1) "1"
}
}
有关为什么不采用我的滤镜的任何帮助?
此处的文档,https://www.dropbox.com/s/kbryi7syan7wt9a/Listings%20API%20Documentation.pdf
答案 0 :(得分:1)
根据您的操作要求,您没有为getListings构建请求消息。
根据您的文档(第24页),过滤器在FilterGroup下定义。并且每个过滤器字段应该在项目标签下。所以请在上面的代码中形成如下所示的请求消息
<getListings>
<username>data</username>
<password>data</password>
<pagenum>data</pagenum>
<pagesize>data</pagesize>
<FILTERGROUP>
<FILTERS>
<ITEM>
<FILTERTYPE>data</FILTERTYPE>
<FIELDCATEGORY>data</FIELDCATEGORY>
<FILTERVALUE>data</FILTERVALUE>
<FIELDNAME>data</FIELDNAME>
</ITEM>
</FILTERS>
<FILTERGROUP>
</getListings>