Who are we?

We are a group of enthousiastic people working for Nedap, a Dutch company with a single goal: solve problems.

Search
« Sort, sort_by and group_by | Main | InnoDB Database migration »
Tuesday
May082007

Ruby + SOAP + Multiple servers

The tutorials make it sound so easy. Plug and play even. Unfortunately reality (as always) bites hard.

SOAP integration is a piece of cake if you have one server and no authentication, but when you do the trouble starts. Although the problem is easy to solve once you know how, the lack of documentation on the subject is annoying.

Ruby's current SOAP implementation supports basic http authorisation during communication, however it does not support getting the WSDL file trough the same authorisation... (Argh! 1 ) So you have to pre-fetch the WSDL file and store it as a file, since Ruby does not support reading the WSDL file from a string (Argh! 2).

Since we have multiple servers running the same application on different ports the cached WSDL file is never correct...(Argh! 3) We solve this by overriding the WSDL's proxy setting.

The final code is short but it took me a while to find all this stuff out so I thought i'd post it here:

require 'soap/wsdlDriver'

# Connection settings
url   = "http://testingserver:3000/webservice"
usr  = "***"
pw  = "***"

wsdl_file = "wsdl/cached_file.wsdl"

factory = SOAP::WSDLDriverFactory.new(wsdl_file).create_rpc_driver
factory.options["protocol.http.basic_auth"] << [ url, usr, pw ]
factory.options["protocol.http.ssl_config.verify_mode"] = nil
factory.proxy.endpoint_url = url

PrintView Printer Friendly Version

EmailEmail Article to Friend

Reader Comments (5)

Tag Heuer became about the added name for alarm Tag Heuer Watches because of their acceptance and affordability. These Replica Tag Heuer can be in fact actual expensive, and accept abundant artist looks. Initially, alarm Replica Tag Heuer Watches were acclimated mostly by sports bodies and aggressive men.

September 24, 2010 | Unregistered Commenterrfew

Post very nicely written, and it contains useful facts. I am happy to find your distinguished way of writing the post. Now you make it easy for me to understand and implement. Thanks for sharing with us.hermes replica handbags

November 24, 2010 | Unregistered CommenterMargaret

I am happy to find your distinguished way of writing the post. Now you make it easy for me to understand and implement.
club penguin cheats

July 26, 2011 | Unregistered CommenterMary

However, if Nike Shoes Cheap the shoes you are buying are for attending a beach party, then UGG Bailey Button Boots 5991 you need something more fashionable and trendy. If you just need Nike Air Force Ones Shoes comfort while at the beach you may want Birkenstock or flip flops.

November 1, 2011 | Unregistered CommenterNike Blazer Sb

high quality copy watches are my cup of tea. I have liked replica tag heuer link watches when i enteredreplica tag heuer formula,replica patek philippe watch) are the best watches, There are all kinds ofreplica panerai luminor in this online store, if you like it, please visit this store, you will enjoy it!!!

November 18, 2011 | Unregistered CommenterAnthony123

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>