Tuesday, January 12, 2010

SoapClient proxy port

When you configure a proxy to access a web service, you must specify 2 parameters : proxy_host and proxy_port.

Note that proxy_port value must be an integer. That seems obvious but problematic if you dynamically load application parameters as constants from a database.

$options = array( 'proxy_host' => PROXY_HOST,
                  'proxy_port' => intval(PROXY_PORT));
$client = new SoapClient( "some.wsdl", $options);