Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要将 SoapClient 绑定到特定的出站网络接口,但我找不到任何关于此的文档。这甚至可能吗?如果没有,有哪些可能的解决方法?
您可以将流上下文传递给具有 bindto 选项集的 soapclient 构造函数:
$opts = array( 'socket' => array( 'bindto' => '192.168.0.100:0', ), ); $ctx = stream_context_create($opts); $client = new SoapClient('the.wsdl', array('stream_context' => $ctx));