Configure a Savon HTTPI Proxy for WSDL and SOAP Requests
Configure the proxy on a Savon HTTPI client and account for both remote WSDL retrieval and SOAP calls.
For a Savon client using HTTPI, the proxy belongs to the client’s options. It applies when retrieving a remote WSDL and when sending the SOAP request.
client = Savon.client(
wsdl: 'https://service.example/soap?wsdl',
proxy: ENV.fetch('SOAP_PROXY_URL'),
open_timeout: 5,
read_timeout: 15
)
The example assumes the HTTPI transport. Supply an approved proxy URL through the environment. For a public SOAP test that permits an unauthenticated HTTP intermediary, a candidate from the HTTP proxy list can supply that URL; keep the service and proxy authentication decisions separate. If its supported authentication method uses URL credentials, encode reserved characters in those credentials and keep the resulting URL out of logs.
Savon calls these “global options,” but they are local to a client instance. A separate client constructed elsewhere does not automatically inherit the proxy.
Check the installed transport before reusing the snippet. Savon’s current documentation assigns these options to HTTPI; its Faraday transport has its own setup interface through client.faraday and rejects these HTTPI-specific options. Configure the selected transport rather than mixing the two interfaces.
Keep the proxy account separate from SOAP service credentials and WS-Security values. A proxy’s 407, a service’s HTTP login challenge and a SOAP fault identify different exchanges. WSDL retrieval can fail before the client has even made an application operation.