Search code examples
phpsoapservicewsdlclient

php5 soap client in wsdl mode how to access different svc endpoint than the one specified in the wsdl


I´m a newbie to soap with php5...

I need to use a wsdl provided by a third party company, where, for testing purposes I´m supposed to use a different access address location for the service I´m needing, than the one specified in the wsdl document.

Is there any way I can create my soap client in wsdl mode, and override the specified address location in the wsdl for a different one?


Solution

  • Pass location using the optional second parameter like this:

    $sc = new SoapClient('urlofmywsdl', array('location' => 'urltowebservice'));