2016-03-05 61 views
-1

我寫了這個代碼,並得到錯誤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.phphttp://vtechvision.com/coupon/api/dgmwsdl2.php

回答

0

我可以解釋爲什麼你在第一種情況下獲得Notice: Array to string conversion in /home/content/09/13963009/html/coupon/api/dgmwsdl1.php on line 12

當你打印$soapClient->GetSales($params);你需要如WSDL所述的傳遞參數

GetSales(string $username, string $password, double $campaignid, string $saleStatus, string $dateFilterType, string $fromDate, string $toDate, double $optionalParams, double $sku) 

但是下一個返回字符串Internal Server Error只是wsdl:service name="dgmpublisherwebservicesService"的響應

相關問題