小编Jør*_*und的帖子

从NuSOAP迁移到PHP5 SOAP

我一直在使用PHP4的脚本,它依赖于NuSOAP.现在,我正在尝试将其移至PHP5,并在那里使用对SOAP的buildin支持.

$wsdlPath = "";    // I have obviously set these variables to something meaningful, just hidden for the sake of security
$apiPath = "";
$username = "";
$password = "";

// PHP5 style
$client = new soapclient($wsdlPath, array('login'=>username,                
'password'=> $password,
'soap_version'=> SOAP_1_2,
'location'=> $apiPath,
 'trace'=> 1));

// PHP4/NuSOAP style
$client = new soapclient($wsdlPath, true);  
client->setEndpoint($apiPath);                          
$client->setCredentials($username, $password);
$client ->loadWSD);
Run Code Online (Sandbox Code Playgroud)

PHP5版本抛出以下异常堆栈跟踪:

EXCEPTION=SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://external-nbb.napi.norwegian.no.stage.osl.basefarm.net/api/napi1300?wsdl' in /home/eisebfog/public_html/database/norwegian.php:31
Stack trace:
#0 /home/eisebfog/public_html/database/norwegian.php(31): SoapClient->SoapClient('http://external...', Array)
#1 /home/eisebfog/public_html/database/index.php(53): …
Run Code Online (Sandbox Code Playgroud)

php port soap wsdl nusoap

6
推荐指数
1
解决办法
1万
查看次数

标签 统计

nusoap ×1

php ×1

port ×1

soap ×1

wsdl ×1