当前位置:Gxlcms > PHP教程 > 求解PHP调用SoapClient报错

求解PHP调用SoapClient报错

时间:2021-07-01 10:21:17 帮助过:4人阅读

class Sign{    public $Uname;    public $Password;    public function __construct($u, $p)	{        $this->Uname = $u;        $this->Password = $p;    }}$auth['Uname'] = 'TestSupplierId';$auth['Password'] = 'TestSupplierSign';$login = new Sign($auth['Uname'], $auth['Password']);$method = 'GetOrder';$cmdid = 'http://sws2.vjia.com/swsmsTest/GetOrderService.asmx';$param['swsSupplierID'] = 'Test';try{$client = new SoapClient($cmdid, array('trace'=>true, 'exceptions'=>true, 'style'=>SOAP_DOCUMENT, 'encoding'=>'UTF-8', 'soap_version'=>SOAP_1_1));$header = new SoapHeader('http://tempuri.org/', 'MySoapHeader', $login, true, SOAP_ACTOR_NEXT);$client->__setSoapHeaders($header);$result = $client->__soapCall($method, array($param));}catch(SoapFault $e){exit($e->faultstring);}exit;

求高人指导


回复讨论(解决方案)

Fatal error: SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://sws2.vjia.com/swsmsTest/GetOrderService.asmx' : Premature end of data in tag html line 3 in E:\wwwroot\os5\diaoyong.php on line 20错误提示

我也遇到这个问题了。

人气教程排行