我一直在使用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);
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): require_once('/home/eisebfog/...') #2 {main}
现在,由于NuSOAP版本确实有效,纯PHP5没有 - 它不需要脑外科医生弄清楚我做错了什么.我可以访问.htaccess文件,并通过phpinfo()确保我正确地运行NuSOAP并在应该运行PHP5时运行PHP5和我应该运行的PHP4/Nusoap.
基本上,我对网络服务和肥皂并不是很好 - 但是如果有人有任何想法,我会很感激我对错误以及如何在PHP5中使用本地肥皂的任何意见.顺便说一下,我首先想要这一举动的共鸣是假定的本地肥皂资源节约.我也很欣赏这两个解决方案之间的基准测试链接.