Home >Backend Development >PHP Tutorial >求解 PHP调用SoapClient报错

求解 PHP调用SoapClient报错

WBOY
WBOYOriginal
2016-06-23 13:59:521434browse

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

我也遇到这个问题了。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn