code_junkie

Moving from NuSOAP to PHP5 SOAP

Nov 12th, 2011
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. $wsdlPath = ""; // I have obviously set these variables to something meaningful, just hidden for the sake of security
  2. $apiPath = "";
  3. $username = "";
  4. $password = "";
  5.  
  6. // PHP5 style
  7. $client = new soapclient($wsdlPath, array('login'=>username,
  8. 'password'=> $password,
  9. 'soap_version'=> SOAP_1_2,
  10. 'location'=> $apiPath,
  11. 'trace'=> 1));
  12.  
  13. // PHP4/NuSOAP style
  14. $client = new soapclient($wsdlPath, true);
  15. client->setEndpoint($apiPath);
  16. $client->setCredentials($username, $password);
  17. $client ->loadWSD);
  18.  
  19. 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
  20. Stack trace:
  21. #0 /home/eisebfog/public_html/database/norwegian.php(31): SoapClient->SoapClient('http://external...', Array)
  22. #1 /home/eisebfog/public_html/database/index.php(53): require_once('/home/eisebfog/...')
  23. #2 {main}
  24.  
  25. if(!extension_loaded('soap')){
  26. dl('soap.so'); // Actually a deprecated method. See "notes" at http://no.php.net/dl
  27. }
  28.  
  29. error_reporting( E_ALL );
Add Comment
Please, Sign In to add comment