I need to create a PHP SOAP client based on this specification:
https://exdev.server.propctrl.com/v5.4/Basic/AgencyIntegration.svc?wsdl
I am able to create my soap client, and when I try to call a function it returns saying access denied:
Message: Access is denied.
Based on documentation, there is no verification/auth method that I first need to call, but it seems I have to use a type called Credentials.
struct Credentials { string Password; string Username; }
I then tried created a Credentials object:
class Credentials {
public function __construct($username, $password)
{
$this->username = $username;
$this->password = $password;
}
}
And assigned new values to it and used it in my SoapHeaders:
$credentials = new Credentials($username, $password);
$header = new SoapHeader('http://localhost','Credentials',$credentials,false);
$client->__setSoapHeaders($header);
When I then use a function I still get the same error:
echo "<pre>";
try {
$response = $client->__soapCall("EchoAuthenticated", array("EchoAuthenticated" => "asdfasdf"));
var_dump($response);
}
//catch exception
catch(Exception $e) {
echo 'Message: ' .$e->getMessage();
}
Message: Access is denied.
I guess my question is that I don't know where/how to pass through the credentials in order for the API to authorise my request.
Any ideas/suggestions?
update1: