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";)
@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.
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to