# SOAP Call from behind proxy

**URL:** <https://www.ruby-forum.com/t/soap-call-from-behind-proxy/173054>\
**Category:** Rails\
**Created:** [August 1, 2009, 2:43am UTC](https://www.ruby-forum.com/t/soap-call-from-behind-proxy/173054 "2009-08-01T02:43:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![davidstokar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/4da419/32.png) [@davidstokar](https://www.ruby-forum.com/u/davidstokar)\
**Post date:** [August 1, 2009, 2:43am UTC](https://www.ruby-forum.com/t/soap-call-from-behind-proxy/173054/1 "2009-08-01T02:43:59Z")

</div>

Hello,

I am trying to do something that I would think is really easy, but that  
doesn’t seem to be the case. I am building an application that my  
internal colleagues can use, but it hits a SOAP web service out on the  
internet. Where I’m struggling is how I can direct the call to our HTTP  
proxy for transmission outside our firewall. For our enterprise campus  
network, all traffic leaving the intranet hits an HTTP proxy.

For my application I was thinking that I have two options. I could use  
SOAP4R to build the SOAP envelope, or I could hardcode the SOAP envelope  
and use a Net::HTTP::Proxy object to pass my homegrown envelope to the  
proxy. I’d personally rather use the first option since using the WSDL  
helps protect me from changes to the format of the message, but I don’t  
have a very good idea on how to direct the SOAP4R method to the proxy,  
with the understanding that the proxy isn’t ultimately the endpoint.

Has anyone else needed to do something similar? I’m running out of ideas  
on how I can accomplish this.

Thanks in advance for any help!  
David

---

<div class="post-metadata">

**Author:** ![davidstokar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/4da419/32.png) [@davidstokar](https://www.ruby-forum.com/u/davidstokar)\
**Post date:** [August 1, 2009, 11:22am UTC](https://www.ruby-forum.com/t/soap-call-from-behind-proxy/173054/2 "2009-08-01T11:22:42Z")

</div>

On Aug 1, 1:43 am, David Sainte-claire \<rails-mailing-l…@andreas-  
[s.net](http://s.net)\> wrote:

> SOAP4R to build the SOAP envelope, or I could hardcode the SOAP envelope  
> and use a Net::HTTP::Proxy object to pass my homegrown envelope to the  
> proxy. I’d personally rather use the first option since using the WSDL  
> helps protect me from changes to the format of the message, but I don’t  
> have a very good idea on how to direct the SOAP4R method to the proxy,  
> with the understanding that the proxy isn’t ultimately the endpoint.

Assuming this a bog standard http proxy, soap4r should handle that  
already. If my memory is correct there’s either an environment  
variable you can set, or you can tell soap4r what proxy (and other  
connection settings to use), I remember the latter being not  
documented (but not too hard to derive from looking at the source  
code)

Fred
