我寫了這個代碼,並得到錯誤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