# Java SOAP Webservice access from rails with the proxy

**URL:** <https://www.ruby-forum.com/t/java-soap-webservice-access-from-rails-with-the-proxy/177690>\
**Category:** Rails\
**Created:** [October 22, 2009, 12:15am UTC](https://www.ruby-forum.com/t/java-soap-webservice-access-from-rails-with-the-proxy/177690 "2009-10-22T00:15:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![siva](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/7c8e57/32.png) [@siva](https://www.ruby-forum.com/u/siva)\
**Post date:** [October 22, 2009, 12:15am UTC](https://www.ruby-forum.com/t/java-soap-webservice-access-from-rails-with-the-proxy/177690/1 "2009-10-22T00:15:14Z")

</div>

I am trying to access the Java SOAP webservice from rails. I need to  
pass the username and password to access the webservice.

This is the code

require ‘soap/wsdlDriver’  
soap\_client = SOAP::WSDLDriverFactory.new(“[http://urlofwebservice?wsdl](http://urlofwebservice?wsdl)”)  
@driver = soap\_client.create\_rpc\_driver  
user = “admin”  
pass = “xxxxx”  
driver.options[“protocol.http.basic\_auth”] \<\< [wsdl,user,pass]

But i am getting the following

Unexpected response: #\<HTTP::Message::Headers:0x67a54f8 @body\_size=0,  
@request\_via\_proxy=nil, @is\_request=false, @response\_status\_code=401,  
@body\_charset=nil, @request\_query=nil, @header\_item=[[“Date”, “Wed, 21  
Oct 2009 22:07:25 GMT”], [“Content-Type”, “text/xml;  
charset="utf-8"”], [“User-Agent”, “WSDL4R (/187, ruby 1.8.6  
(2008-08-11) [i386-mswin32])”], [“Server”, “Forum Sentry”],  
[“WWW-Authenticate”, “Basic realm="HttpListenerPolicy-0"”],  
[“Content-Length”, “615”]], @body\_type=nil, @request\_uri=nil,  
@body\_date=nil, @request\_method=nil, @http\_version=“1.1”,  
@reason\_phrase=“Unauthorized”, @chunked=false\>

Please help me to resolve .

Thanks  
Siva.
