Php 故障代码:HTTP字符串:无法连接到主机
当尝试使用SOAP请求获取联邦快递费率时,我使用PHP和XAMPP,得到以下错误: 过失 代码:HTTP字符串:无法连接到主机 在此代码中:Php 故障代码:HTTP字符串:无法连接到主机,php,soap,ubuntu-12.04,Php,Soap,Ubuntu 12.04,当尝试使用SOAP请求获取联邦快递费率时,我使用PHP和XAMPP,得到以下错误: 过失 代码:HTTP字符串:无法连接到主机 在此代码中: <?php require_once('library/fedex-common.php'); $path_to_wsdl = "wsdl/RateService_v13.wsdl"; ini_set("soap.wsdl_cache_enabled", "0"); $client = new So
<?php
require_once('library/fedex-common.php');
$path_to_wsdl = "wsdl/RateService_v13.wsdl";
ini_set("soap.wsdl_cache_enabled", "0");
$client = new SoapClient($path_to_wsdl, array('trace' => 1));
try {
if(setEndpoint('changeEndpoint')) {
$newLocation = $client->__setLocation(setEndpoint('endpoint'));
}
$response = $client ->getRates($request);
} catch (SoapFault $exception) {
printFault($exception, $client);
}
?>
这只发生在Ubuntu上。但是,同样的代码也使用XAMPP在Windows上运行良好。请向我们展示用于执行此操作的代码。错误发生在该行中?我怀疑你有一些实际的SOAP代码在执行请求。实际上没有代码错误这是一个错误。我无法在请求时连接主机。