Skip to content
Mikaël DELSOL edited this page Sep 10, 2015 · 20 revisions

Basic Authentication work around

How to generate a package using a WSDL protected by a Basic Authentication?
$ wget https://phar.wsdltophp.com/wsdltophp.phar
$ ./wsdltophp.phar generate:package \
    --urlorpath="http://www.mydomain.com/wsdl.xml" \
    --destination="/path/to/where/the/package/must/be/generated/" \
    --prefix="MyPackage" \
    ###############################################
    # Here are the Basic Authentication credentials
    --login="basic_auth_login" \
    --password="basic_auth_password" \
    ###############################################
    --force
Call a SOAP Web Service using a WSDL protected by a Basic Authentication?
use WsdlToPhp\PackageBase\AbstractSoapClientBase;
$options = array(
    AbstractSoapClientBase::WSDL_URL => 'http://www.mydomain.com/wsdl.xml',
    AbstractSoapClientBase::WSDL_CLASSMAP => \MyPackage\MyPackageClassMap::get(),
    ###############################################
    # Here are the Basic Authentication credentials
    AbstractSoapClientBase::WSDL_LOGIN => 'basic_auth_login',
    AbstractSoapClientBase::WSDL_LOGIN => 'basic_auth_password',
    ###############################################
);
Clone this wiki locally