我正在尝试从SOAP API(complexType)中获取数据,但它说我提供的数据不正确。
错误消息我正在:“错误的组合LINKCODE / LINKHASH” (LINKCODE代表CompanyId& LINKHASH代表linkHash)
奇怪的是,当我尝试使用http://www.soapclient.com/soaptest.html获取数据时,它可以正常工作......
我是否有必须提供的方案,例如方案或编码?
无论如何,这是我的代码:
<?php
include_once 'getArticles.class.php';
$objGetArticles = new getArticles();
$objGetArticles->CompanyId = 'xxx';
$objGetArticles->linkHash = 'xxx';
$objGetArticles->SyncOnlyGlobalPrices = 1;
$wsdl = "https://wcupwebservice.syscom.be/wsWCupDemo/wsWCupDemo.exe/wsdl/IwsWCup";
$client = new SoapClient($wsdl,
array (
'trace' => 1,
'exceptions' => 0,
'cache_wsdl' => WSDL_CACHE_NONE,
'keep_alive' => false
)
);
try {
$result = $client->getArticles(new SoapVar($objGetArticles, SOAP_ENC_OBJECT));
echo "<pre>";
print_r($result);
}catch (SOAPFault $f) {
echo $f->getMessage();
}catch (Exception $e) {
echo $e->getMessage();
}
getArticles.class.php:
<?php
class getArticles{
var $CompanyId;
var $linkHash;
var $SyncOnlyGlobalPrices;
}
有人知道该怎么做吗?我已经在这上花了那么多时间..谢谢!