# Ruby SOAP Client Question

**URL:** <https://www.ruby-forum.com/t/ruby-soap-client-question/98891>\
**Category:** Ruby\
**Created:** [July 18, 2006, 9:13pm UTC](https://www.ruby-forum.com/t/ruby-soap-client-question/98891 "2006-07-18T21:13:15Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![gregarican](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/7feea3/32.png) [@gregarican](https://www.ruby-forum.com/u/gregarican)\
**Post date:** [July 18, 2006, 9:13pm UTC](https://www.ruby-forum.com/t/ruby-soap-client-question/98891/1 "2006-07-18T21:13:15Z")

</div>

I am attempting to write a small SOAP client script using Ruby 1.8.2  
for Windows. The SOAP server will be located on the other side of an  
authenticating proxy server. I see there’s a #setHttpProxy method  
available that I can use to specify the host and the port. Is there a  
quick and easy way to set the username and password? I tried using  
[http://username:removed\_email\_address@domain.invalid](http://username:removed_email_address@domain.invalid) as the URL but no luck.

Any suggestions?

---

<div class="post-metadata">

**Author:** ![gregarican](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/7feea3/32.png) [@gregarican](https://www.ruby-forum.com/u/gregarican)\
**Post date:** [July 18, 2006, 9:23pm UTC](https://www.ruby-forum.com/t/ruby-soap-client-question/98891/2 "2006-07-18T21:23:39Z")

</div>

gregarican wrote:

> I am attempting to write a small SOAP client script using Ruby 1.8.2  
> for Windows. The SOAP server will be located on the other side of an  
> authenticating proxy server. I see there’s a #setHttpProxy method  
> available that I can use to specify the host and the port. Is there a  
> quick and easy way to set the username and password? I tried using  
> [http://username:removed\_email\_address@domain.invalid](http://username:removed_email_address@domain.invalid) as the URL but no luck.
> 
> Any suggestions?

See

> **[SOAP + Basic Authentication in Ruby](http://chrismcmahonsblog.blogspot.com/2006/03/soap-basic-authentication-in-ruby.html)**
>
> Do you need to do SOAP in Ruby? First of all, install the latest version of Ruby you can stand. (I'm using this one . What the heck. I'...

for instructions on basic authentication.

-Chris

---

<div class="post-metadata">

**Author:** ![gregarican](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/7feea3/32.png) [@gregarican](https://www.ruby-forum.com/u/gregarican)\
**Post date:** [July 18, 2006, 9:37pm UTC](https://www.ruby-forum.com/t/ruby-soap-client-question/98891/3 "2006-07-18T21:37:00Z")

</div>

Thanks for submitting this. What you have posted appears to deal with a  
WSDL service that requires client authentication. I am talking about a  
proxy server that sits between the client and the WSDL service. Right  
now I am noodling around with SOAP::Env.getenv(‘http\_proxy’) to see if  
I can get the username:password portion of the URI to parse out so I  
can use the #setHttpProxy method. We’ll see…

---

<div class="post-metadata">

**Author:** ![gregarican](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/7feea3/32.png) [@gregarican](https://www.ruby-forum.com/u/gregarican)\
**Post date:** [July 18, 2006, 10:02pm UTC](https://www.ruby-forum.com/t/ruby-soap-client-question/98891/4 "2006-07-18T22:02:43Z")

</div>

gregarican wrote:

> > > for Windows. The SOAP server will be located on the other side of an
> > 
> > -Chris

Would SOAP::HTTPConfigLoader::set\_basic\_auth(…) be of any help with  
this? (Just a shot in the dark - I’ve only done a little w/soap and it  
was a while back.)

Ken

---

<div class="post-metadata">

**Author:** ![gregarican](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/7feea3/32.png) [@gregarican](https://www.ruby-forum.com/u/gregarican)\
**Post date:** [July 19, 2006, 2:45am UTC](https://www.ruby-forum.com/t/ruby-soap-client-question/98891/5 "2006-07-19T02:45:25Z")

</div>

-----BEGIN PGP SIGNED MESSAGE-----  
Hash: SHA1

Hi,

gregarican wrote:

> I am attempting to write a small SOAP client script using Ruby 1.8.2  
> for Windows. The SOAP server will be located on the other side of an  
> authenticating proxy server. I see there’s a #setHttpProxy method  
> available that I can use to specify the host and the port. Is there a  
> quick and easy way to set the username and password? I tried using

Unfortunately current soap4r (including development version) does not  
support Proxy (basic) Authentication. If I remember correctly, net/http  
support Proxy (basic) Authentication so I should be able to implement  
this feature easily.

Is there anyone who have done this fix?

Regards,  
// NaHi  
-----BEGIN PGP SIGNATURE-----  
Version: GnuPG v1.4.2.1 (Cygwin)

iQEVAwUBRL16tx9L2jg5EEGlAQJewggAsbouEK+rzQKOEavL2ZrAp/nJ09LK7JRc  
G1IeaIAWafm4d0vHsP+jNicqHvVz9d8NO1UvpX0+bQ0GaJmy6rx1dwB6h3n3KJcH  
DLVPNQ+2bPcMT4+4pvLrnIgySZQa/3N7b6vnpdQdUk5FRKyJJScHF9t6lKheD2zP  
IeKe96v6A+FrZO/ef43LT+jUR1vQZRCkGm5iq6ngVPln7Ds1XqKPuZQCVV7skUdA  
WmKqOwelinwFNQyidTwOMFJGP10QEBILrUWZz6futBHX5Fxk0cJTh8BAE6EF+j0d  
ci43eK+8i+Sje57thJZB0TbZlr55GbfvmPEfG9zhmaHo8iKVxGhcYg==  
=crOO  
-----END PGP SIGNATURE-----

---

<div class="post-metadata">

**Author:** ![gregarican](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/7feea3/32.png) [@gregarican](https://www.ruby-forum.com/u/gregarican)\
**Post date:** [July 19, 2006, 3:29am UTC](https://www.ruby-forum.com/t/ruby-soap-client-question/98891/6 "2006-07-19T03:29:05Z")

</div>

I haven’t done this personally, but I think that would be very nice  
addition. I’ve needed it a couple of times for sure.

+1.
