16
我试图在代理之后运行PHP SoapClient和SoapServer(用于Magento),其中唯一的网络流量允许通过代理服务器。在代理之后运行PHP SoapServer
我有这方面的工作与客户像这样:
$client = new SoapClient('https://www.domain.co.uk/api/v2_soap/?wsdl=1', [
'soap_version' => SOAP_1_1,
'connection_timeout' => 15000,
'proxy_host' => '192.168.x.x',
'proxy_port' => 'xxxx',
'stream_context' => stream_context_create(
[
'ssl' => [
'proxy' => 'tcp://192.168.x.x:xxxx',
'request_fulluri' => true,
],
'http' => [
'proxy' => 'tcp://192.168.x.x:xxxx',
'request_fulluri' => true,
],
]
),
]);
可正常工作 - 所有的业务通过代理服务器去。
但是,对于SoapServer类,我无法确定如何强制它通过SoapServer发送所有出站流量。它似乎试图直接从网络加载http://schemas.xmlsoap.org/soap/encoding/,而不是通过代理,导致“无法从'http://schemas.xmlsoap.org/soap/encoding/'导入模式”错误被抛出。
我已经尝试将schemas.xmlsoap.org的主机文件条目添加到127.0.0.1并在本地托管此文件,但我仍然遇到同样的问题。
有什么我失踪了吗?