NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
How to access (w. nuSOAP) a webservice protected by htaccess


Joined: 25 Apr 2004
Posts: 1
Reply with quote
Hello,

I have created a webservice in php using nusoap.

The php file containing the function available through the webservice is protected by a htaccess file.

When I try to connect the client (also in php) to the webservice, an error message indicated that authorization is required.

So, I have done like this but it doesn't work :

$server=new soapclient("http:\\localhost\test.php");
$server->setCredentials("testID","testPassword");
$server->call("functionName",$functionParameters);

What should I do to authenticate ?

Thank you for your answers.
View user's profileFind all posts by cattafestaSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8334
Reply with quote
If WSDL url points to the same server as its operations and it requires authentication, you'd add username/password to the URL, like this:

Code:
$server=new soapclient("http://testID:testPassword@localhost/test.php");
$server->setCredentials("testID","testPassword");


BTW, operations may require different credentials each.

Should be noted, that NuSoap supports BASIC AUTHENTICATION only.
(e.g. it does not support HTTP/DIGEST)
It means that passwords are passed in plain form and in order to set up security you'd use HTTPS protocol.
View user's profileFind all posts by dmitriSend private messageVisit poster's website
How to access (w. nuSOAP) a webservice protected by htaccess
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic