# Odd HTTP headers causing SOAP to fail

**URL:** <https://www.ruby-forum.com/t/odd-http-headers-causing-soap-to-fail/53776>\
**Category:** Ruby\
**Created:** [February 14, 2006, 3:13pm UTC](https://www.ruby-forum.com/t/odd-http-headers-causing-soap-to-fail/53776 "2006-02-14T15:13:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dido\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b3f665/32.png) [@Dido\_S](https://www.ruby-forum.com/u/Dido_S)\
**Post date:** [February 14, 2006, 3:13pm UTC](https://www.ruby-forum.com/t/odd-http-headers-causing-soap-to-fail/53776/1 "2006-02-14T15:13:09Z")

</div>

I’ve been tasked to interop with a SOAP gateway provided by another  
company to access their service, and have tried to write a program  
using the soap4r that’s integrated with Ruby 1.8.4, based on some code  
those people have written for Perl’s SOAP::Lite. I’ve ran into strange  
errors when attempting to make SOAP calls to their server, which is  
apparently based on IIS. A wiredump shows the following:

-\> “HTTP/1.1 100 Continue\r\n”  
-\> “Server: Microsoft-IIS/5.0\r\n”  
-\> “Date: Tue, 14 Feb 2006 11:04:56 GMT\r\n”  
-\> “\r\n”  
-\> “HTTP/1.1 200 OK\r\n”  
-\> “Server: Microsoft-IIS/5.0\r\n”  
-\> “Date: Tue, 14 Feb 2006 11:05:06 GMT\r\n”  
-\> “Connection: close\r\n”  
-\> “HTTP/1.1 200 OK\r\n”  
/usr/lib/ruby/1.8/net/http.rb:2006:in `each_response_header': wrong header line format (Net::HTTPBadResponse) from /usr/lib/ruby/1.8/net/http.rb:1979:in`read\_new’  
from /usr/lib/ruby/1.8/net/http.rb:1046:in `request' from /usr/lib/ruby/1.8/net/http.rb:840:in`post’  
from /usr/lib/ruby/1.8/soap/netHttpClient.rb:93:in `post' from /usr/lib/ruby/1.8/soap/netHttpClient.rb:116:in`start’  
from /usr/lib/ruby/1.8/net/http.rb:545:in `start' from /usr/lib/ruby/1.8/soap/netHttpClient.rb:115:in`start’  
from /usr/lib/ruby/1.8/soap/netHttpClient.rb:92:in `post' from /usr/lib/ruby/1.8/soap/streamHandler.rb:170:in`send\_post’  
from /usr/lib/ruby/1.8/soap/streamHandler.rb:109:in `send' from /usr/lib/ruby/1.8/soap/rpc/proxy.rb:170:in`route’  
from /usr/lib/ruby/1.8/soap/rpc/proxy.rb:141:in `call' from /usr/lib/ruby/1.8/soap/rpc/driver.rb:178:in`call’  
from /usr/lib/ruby/1.8/soap/rpc/driver.rb:232:in `login’  
from soaptest.rb:23

It appears that their IIS server resent the ‘HTTP/1.1 200 OK’ status  
line, and that caused net/http to raise the wrong header line format  
exception. The equivalent code with Perl and SOAP::Lite has no  
problems making calls on their site. A desperate, one-line addition to  
net/http.rb, after line 2003, adding the following:

```
      next if line =~ /^HTTP/

```

seems like it’s able to work around the bug, and now my Ruby SOAP  
program works alright. Of course, I’m not happy with this local patch  
that I’ve done (an upgrade will instantly break my programs unless  
this has been addressed), and am wondering if anyone else has  
encountered this type of behavior with IIS or other HTTP servers, used  
either in a SOAP context or otherwise. The fact that SOAP::Lite (0.66,  
and libwww-perl 5.803) on Perl 5.8.7 had no trouble with their site  
makes me feel that this is a bug.

By the way, exact system description: Gentoo Linux, Ruby 1.8.4-r1,  
soap4r 1.5.5. The same behavior manifests on Ruby 1.8.2.

---

<div class="post-metadata">

**Author:** ![Dido\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b3f665/32.png) [@Dido\_S](https://www.ruby-forum.com/u/Dido_S)\
**Post date:** [February 14, 2006, 4:54pm UTC](https://www.ruby-forum.com/t/odd-http-headers-causing-soap-to-fail/53776/2 "2006-02-14T16:54:07Z")

</div>

On Tuesday 14 February 2006 08:15 pm, Dido S. wrote:

Please email NaHi removed\_email\_address@domain.invalid  
and/or  
use the trac [http://dev.ctor.org/soap4r](http://dev.ctor.org/soap4r)

Tsume
