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);
?>