首页 >后端开发 >php教程 >求解 PHP调用SoapClient报错

求解 PHP调用SoapClient报错

WBOY
WBOY原创
2016-06-23 13:59:521434浏览

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错误提示

我也遇到这个问题了。

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn