|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-06-23 20:53 UTC] sjoerd-php at linuxonly dot nl
[2009-09-19 01:00 UTC] doc-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 19 01:00:01 2025 UTC |
Description: ------------ I can not set my authentication header at the same time as I set my client. Because of this, I get a fatal error at the point where the client is set, before the headers can be set. Because the service uses the header for authentication, I cannot get to the service. As a workaround/test, I moved the contents of the service (which I accessed through a browser, requiring me to login), and pointed the client to the local version. This works great. Obviously not ideal. If I use NULL as my service URL and set the location and uri, this almost seems to work, except then I am in non-WSDL mode, and none of the get methods work. I tried setting it as non-WSDL and using setLocation after setting the headers, no luck. All I get is NULL for getFunctions(). So is it possible to set the headers at the same time as setting the client? If so, this would be very helpful in the documentation. If not, a link to the correct method for doing so would be great. Reproduce code: --------------- --- From manual page: soapclient.setsoapheaders --- $service = "servicetest.xml"; $namespace = "urn:NameOfService"; $client = new SoapClient($service); $authHeaders["login"] = "user"; $authHeaders["password"] = "password"; $header=new SoapHeader($namespace ,'Authentication', $authHeaders); $client->__setSoapHeaders($header); var_dump($client->__getFunctions()); Expected result: ---------------- A list of functions for that service. Actual result: -------------- When pointing to remote service: Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'path/to/service' in /path/to/myscript.php:6 Stack trace: #0 /path/to/myscript.php(6): SoapClient- >SoapClient('https://path/to/serv...') #1 {main} thrown in /path/to/myscript.php on line 6 When pointing to local copy of service: A list of functions for that service.