Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WSDL to PHP with Basic Auth

I need to build php classes from a WSDL that is behind basic auth.

It has tons of namespaces so it looks burdensome to do this by hand.

I have tried a few tools but looks like the auth session isn't presistent.

like image 509
BigPoppa Avatar asked Apr 18 '12 23:04

BigPoppa


2 Answers

$options = array(
     'login' => $username,
     'password' => $password,
);
$client = new SoapClient($wsdl, $options);

Yes, it works! I tried in a solution that I was building and it connects to my customer WS which is with HTTP Basic Auth.

like image 168
aemerich Avatar answered Sep 28 '22 04:09

aemerich


HTTP Auth works with SOAP Client, however you cannot access password protected WSDL files

See https://bugs.php.net/bug.php?id=27777

like image 36
Kinetic Avatar answered Sep 28 '22 05:09

Kinetic