PEAR SOAP and HTTP Basic Authentication
| From: | Marco | Date: | Fri, 05 Oct 2007 10:49:02 +0000 |
| Subject: | PEAR SOAP and HTTP Basic Authentication | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-28046@lists.php.net to get a copy of this message | ||
Hi All
I am trying to use PEAR SOAP with HTTP Basic Authentication but no matter what I try it doesnt seem to work.
Here is some code I have been using
<?php
require_once('SOAP/Client.php');
$arrProxy = array('user'=>'XXXXX','pass'=>'XXXXXX');
$objWsdl = new SOAP_WSDL("https://www.mysoapserver.com/soap.asmx?wsdl",$arrProxy);
$objSoapClient = $objWsdl->getProxy();
?>
This comes back with the error message
soap_fault Object
(
[error_message_prefix] =>
[mode] => 1
[level] => 1024
[code] => WSDLCACHE
[message] => Unable to retrieve WSDL https://www.mysoapserver.com/soap.asmx?wsdl,
[userinfo] => https://www.mysoapserver.com/soap.asmx?wsdl
So I thought I would get even simpler and try it with the HTTP_Request class
require_once "HTTP/Request.php";
$req =& new HTTP_Request("https://www.mysoapserver.com/soap.asmx?wsdl");
$req->setBasicAuth("XXXXX", "XXXXX");
This comes back with a pear_error Object
[error_message_prefix] =>
[mode] => 1
[level] => 1024
[code] => 0
[message] => The operation completed successfully.
[userinfo] =>
If I access the URL using my browser and the username / password I can access the WSDL file no problem.
Can anyone point out where I am going wrong?
TIA
Marco