欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

求解 PHP调用SoapClient报错

程序员文章站 2022-05-27 12:47:36
...
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错误提示

我也遇到这个问题了。