# SOAP WSDLFactory

**URL:** <https://www.ruby-forum.com/t/soap-wsdlfactory/164021>\
**Category:** Rails\
**Created:** [March 27, 2009, 12:10am UTC](https://www.ruby-forum.com/t/soap-wsdlfactory/164021 "2009-03-27T00:10:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![BenH](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/8baadc/32.png) [@BenH](https://www.ruby-forum.com/u/BenH)\
**Post date:** [March 27, 2009, 12:10am UTC](https://www.ruby-forum.com/t/soap-wsdlfactory/164021/1 "2009-03-27T00:10:34Z")

</div>

I’ve created a method for creating a SOAP WSDL driver.  
I’ve tested this without basic auth and without SSL and it works  
great. The sysadmin has enabled SSL and basic auth and now I’m stuck.

The error is:  
HTTPClient::BadResponseError: unexpected response:  
#\<HTTP::Message::Headers:0x2aaaae21cd10 @body\_date=nil,  
@status\_code=401, @dumped=false, @body\_size=0, @body\_charset=nil,  
@request\_via\_proxy=nil, @chunked=false, @header\_item=[[“Content-  
Length”, “1656”], [“Content-Type”, “text/html”], [“Server”, “Microsoft-  
IIS/6.0”], [“WWW-Authenticate”, “Negotiate”], [“WWW-Authenticate”,  
“NTLM”], [“X-Powered-By”, “[ASP.NET](http://ASP.NET)”], [“Date”, “Thu, 26 Mar 2009  
21:12:23 GMT”]], @body\_type=nil, @request\_query=nil,  
@is\_request=false, @reason\_phrase=“Unauthorized”, @request\_uri=nil,  
@http\_version=“1.1”, @request\_method=nil\>

Which seems to indicate a failed authentication…

Here’s the method:

def create\_record\_driver # WS for creating a new record  
username = “username”  
password = “mypassword”  
ws\_site = “https://#{BASE\_SITE}/ws/CreateRecord.asmx”  
wsdl = “#{ws\_site}?WSDL”  
drv = SOAP::WSDLDriverFactory.new(wsdl).create\_rpc\_driver  
drv.options[‘protocol.http.ssl\_config.verify\_mode’] =  
OpenSSL::SSL::VERIFY\_NONE  
drv.options[“protocol.http.basic\_auth”] \<\< [ ws\_site, username,  
password ]  
return drv  
end

Any help would be appreciated.
