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 to
This is Simple example to authenticate webservice using soapClient
$apiauth =array('UserName'=>'abcusername','Password'=>'xyzpassword','UserCode'=>'1991');
$wsdl = 'http://sitename.com/service.asmx?WSDL';
$header = new SoapHeader('http://tempuri.org/', 'AuthHeader', $apiauth);
$soap = new SoapClient($wsdl);
$soap->__setSoapHeaders($header);
$data = $soap->methodname($header);
This code internally parse header as follow
<soap:Header>
<AuthHeader xmlns="http://tempuri.org/">
<UserName>abcusername</UserName>
<Password>xyzpassword</Password>
<UserCode>1991</UserCode>
</AuthHeader>
</soap:Header>