以下是进行SOAP调用的代码
require_once("zulutradeClient.php");
date_default_timezone_set('America/New_York');
$params->providerId = 128391;
$params->validTrades = true;
$params->lotSize = "Standard";
$params->start = 0;
$params->length = 20;
//$params->sortAscending = false;
$params->fromDateStr = "1986-08-27T09:00:00";
$params->toDateStr = "2014-01-12T09:00:00";
$params->sortBy = "dc";
$ztclient = new zulutradeClient();
$response = "";
try {
$response = $ztclient->GetProviderTrades( $params );
var_dump($response);
}
catch (SoapFault $e) {
var_dump($e);
}
wsdl在这里
http://www.zulutrade.com/WebServices/Performance.asmx?WSDL
当'sortAscending'被注释掉时,我得到no属性错误:
SOAP-ERROR: Encoding: object has no 'sortAscending' property"
取消注释后,我收到以下错误:
message: Could not connect to host
faultcode: http
似乎真的没有希望,我已经尝试了一切,而且它只是不想接受那个参数。
答案 0 :(得分:0)
When the 'sortAscending' is commented out, i get the no property error:
SOAP-ERROR: Encoding: object has no 'sortAscending' property"
<s:element minOccurs="1" maxOccurs="1" name="sortAscending" type="s:boolean" />
sortAscending是wsdl中的必填字段,这就是您遇到错误的原因。
When it is uncommented I get the following error:
message: Could not connect to host
faultcode: http
此处您的请求肥皂消息没有错误。这里的问题是,这个终点url。
http://www.zulutrade.com:81/WebServices/Performance.asmx
无法访问。关于此与您的wsdl提供商联系。你无能为力。 最有可能的是,这个服务将托管在其他一些端口而不是81。