我正在尝试使用laravel 4.2中的Web服务,但是可以在本地计算机上运行,但可以在实时服务器上运行 我的控制器
ini_set('max_execution_time',10);
$headers = array(
"Content-type: text/xml;charset=\"utf-8\"",
"Accept: text/xml",
"Cache-Control: no-cache",
"Pragma: no-cache",
"trace" => 1, // enable trace to view what is happening
"exceptions" => 0, // disable exceptions
"cache_wsdl" => 0
); //SOAPAction: your op URL
$vendorCode = Input::get('name');
$password = Input::get('password');
$client = new SoapClient('https://xxxxxxxxx.asmx?WSDL', $headers);
$params = array(
'vendorcode'=> $vendorCode,
'password'=> $password,
);
$results = $client->GetAccountBalance($params);
$response = $results->GetAccountBalanceResult;
它带来的错误看起来像这样
SOAP-ERROR:解析WSDL:无法从' https://XXXXXXXXX.asmx?WSDL'加载:未能加载外部实体" https://XXXXXXXXX.asmx?WSDL"
提前致谢