Currently we have a problem while implementing a SOAP service for a client of ours. Essentially, we are exposing methids for them to call to as we do not want to give them direct access to our databases. As such , they have also requested that we add user authentication in the form of a user name and password pair in the header of the client to be verified on the server side.
Thats been done. Works great. Except the problem now is that they are trying to develop their SOAP client and app using .NET. Yes, hate me for asking, but thats what they are doing. And apparently they are complaining now because .NET cannot send the user name and password pair because it is not defined as a header in the WSDL.
I have struggled to find a way to force NuSOAP to describe the user name and password header info in the WSDL, but have come up empty.
I also have to admit to being a relative newby concering SOAP, so I am not familiar with the exact structure to "manually" add the information into the WSDL as I have seen suggested on other sites.
The code for the client sending the header is:
include_once ('nusoap/lib/nusoap.php');
$client = new soapclient('http://#################', true);
$err = $client->getError();
$auth_array = array("Username" => "usernamehere", "Password"=>"choose_a_pass");
$headers_array = array("UserCredentials"=>array($auth_array));
$client->setHeaders($headers_array);
if ($err)
{
echo "Constructor error";
}
|
Any and all help will be appreciated with this.