我写了这个代码,并得到错误SoapClient的流汗注意:数组字符串转换和
声明:Array对在/ home /内容字符串转换/ 09/13963009/HTML /优惠券/ API/dgmwsdl1。对行PHP 12
错误:内部服务器错误
<?php
error_reporting(E_ALL);
ini_set("display_errors", 1);
$soapClient = new SoapClient('http://webservices.dgperform.com/dgmpublisherwebservices.cfc?wsdl');
echo '<pre>';
// shows the methods coming from the service
print_r($soapClient->__getFunctions());
print_r($soapClient->__getTypes());
$params = array('Dg-Affiliate-Id' => 'xxxx','Dg-Affiliate-Token' => 'xxxx','fromDate' => '2015-01-31','toDate' => '2016-03-04');
// $params = array('username' => 'xxxx','password' => 'xxxx','fromDate' => '2015-01-31','toDate' => '2016-03-04');
try {
$auth_call=$soapClient->GetSales($params);
// $auth_call=$soapClient->__soapCall("GetSales", $params);
print_r($auth_call);
die();
}
catch (SoapFault $fault) {
die('Error : ' . $fault->faultstring);
}
?>
第二脚本不同的呼叫
<?php
error_reporting(E_ALL);
ini_set("display_errors", 1);
$soapClient = new SoapClient('http://webservices.dgperform.com/dgmpublisherwebservices.cfc?wsdl');
echo '<pre>';
// shows the methods coming from the service
print_r($soapClient->__getFunctions());
print_r($soapClient->__getTypes());
$params = array('Dg-Affiliate-Id' => 'xxxx','Dg-Affiliate-Token' => 'xxxx','fromDate' => '2015-01-31','toDate' => '2016-03-04');
// $params = array('username' => 'xxxx','password' => 'xxxx','fromDate' => '2015-01-31','toDate' => '2016-03-04');
try {
//$auth_call=$soapClient->GetSales($params);
$auth_call=$soapClient->__soapCall("GetSales", $params);
print_r($auth_call);
die();
}
catch (SoapFault $fault) {
die('Error : ' . $fault->faultstring);
}
?>
错误:内部服务器错误
对于实时脚本,你可以参考http://vtechvision.com/coupon/api/dgmwsdl1.php和http://vtechvision.com/coupon/api/dgmwsdl2.php