Running PHP SoapServer behind a proxy : <p>I'm attempting to run both a PHP SoapClient and a SoapServer (for Magento) behind a proxy, where the only network traffic allowed out is via the proxy server.</p>

<p>I have got this working with the client as so:</p>

<pre><code>$client = new SoapClient('https://www.domain.co.uk/api/v2_soap/?wsdl=1', [
    'soap_version' =&gt; SOAP_1_1,
    'connection_timeout' =&gt; 15000,
    'proxy_host' =&gt; '192.168.x.x',
    'proxy_port' =&gt; 'xxxx',
    'stream_context' =&gt; stream_context_create(
        [
            'ssl' =&gt; [
                'proxy' =&gt; 'tcp://192.168.x.x:xxxx',
                'request_fulluri' =&gt; true,
            ],
            'http' =&gt; [
                'proxy' =&gt; 'tcp://192.168.x.x:xxxx',
                'request_fulluri' =&gt; true,
            ],
        ]
    ),
]);
</code></pre>

<p>This works as expected - all the traffic is going via the proxy server.</p>

<p>However, with the SoapServer class, I can't work out how to force it to send all outbound traffic via the SoapServer. It appears to be trying to load <a href="http://schemas.xmlsoap.org/soap/encoding/">http://schemas.xmlsoap.org/soap/encoding/</a> directly form the network, not via the proxy, which is causing the "can't import schema from '<a href="http://schemas.xmlsoap.org/soap/encoding/">http://schemas.xmlsoap.org/soap/encoding/</a>'" error to be thrown.</p>

<p>I've tried adding a hosts file entry for schemas.xmlsoap.org to 127.0.0.1 and hosting this file locally, but I'm still getting the same issue.</p>

<p>Is there something I'm missing?</p>
