2016-03-05 29 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"的响应

相关问题