How do I call a WSDL (SOAP and HTTP protocol) in PHP through a proxy where the web services uses a login/password authentication?
My application has to create an object with the login/password provided by the web- services-provider and associate this object with the web services’ security object.

This is my code"

<?php
/
WSDL client sample.
Service: WSDL
Transport: http
*/

require_once('../lib/nusoap.php');

class Authentication {

/ These are the authentication properties /
var $Login;
var $Password;

/ Constructor. Called as soon as we create a login paramaters /
function Authentication($accountLogin, $accountPassword) {
$this->Login = $accountLogin;
$this->Password = $accountPassword;
}
}

$proxyhost = "proxy.bla.bla";
$proxyport = 777;
$proxyusername = '';
$proxypassword = '';

$username = 'someone@someware';
$password = 'password';
$client = new soapclient("$wsdl", true,$proxyhost, $proxyport, $proxyusername,$proxypassword);

$err = $client->getError();
if ($err) {
echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
}
// Things already go wrong here

$auth = new Authentication($username,$password);

?>

    4 years later

    Does anyone know if the issue is fixed. According to the bug report it is, yet I seem to be having a similar issue under PHP 5.2.5.

    I am operating on a PHP web server using a proxy between me and the remote web server with which I need to exchange information. I am constrained to using PHP and SOAP. XML-RPC is not an option.

      Write a Reply...