Introduction
You have a PHP SOAP application that needs to connect from a specific IP address, such as a domain's dedicated IP address.
Procedure
To do this, add a bindto value for the specific IP address into the PHP script that makes the SOAP call, for example (make sure to replace the IP address, location, and uri values with the actual values needed by the script):
$opts = array('socket' => array('bindto' => '192.0.2.100:0'));
$context = stream_context_create($opts);
$client = new SoapClient(null, array('location'=>'http://remoteserver.domain.com','uri' => 'http://test-uri.domain.com/','stream_context' => $context));
Comments
0 comments
Article is closed for comments.