summaryrefslogtreecommitdiff
path: root/sample/soap/babelfish.rb
blob: eb2421449a2d1753df1925ae58748358e54367a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/env ruby

text = ARGV.shift || 'Hello world.'
lang = ARGV.shift || 'en_fr'

require 'soap/rpc/driver'

server = 'http://services.xmethods.net/perl/soaplite.cgi'
InterfaceNS = 'urn:xmethodsBabelFish'
wireDumpDev = nil	# STDERR

drv = SOAP::RPC::Driver.new(server, InterfaceNS)
drv.wiredump_dev = wireDumpDev
drv.add_method_with_soapaction('BabelFish', InterfaceNS + "#BabelFish", 'translationmode', 'sourcedata')

p drv.BabelFish(lang, text)