I need to bind a SoapClient to a specific outbound network interface, but I cannot find any documentation on this. Is this even possible? If not, what are some possible workarounds?
views:
16answers:
1
+3
A:
You can pass a stream context to your soapclient constructor that has a bindto options set:
$opts = array(
'socket' => array(
'bindto' => '192.168.0.100:0',
),
);
$ctx = stream_context_create($opts);
$client = new SoapClient('the.wsdl', array('stream_context' => $ctx));
cythrawll
2010-08-09 21:45:36
Wow, simple. Thanks!
hobodave
2010-08-09 21:50:27