Welcome to the "trac"-ing site of soap4r!
[soap4r] [httpclient] [openpgp4u] [pkcs1] [logger] [csv] [vtr]

root/tags/RELEASE_1_4_4/sample/babelfish.rb

Revision 457, 0.5 kB (checked in by nahi, 7 years ago)

Use environment variable HTTP_PROXY or http_proxy for http proxy.

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to author date id revision
Line 
1 #!/usr/bin/env ruby
2
3 text = ARGV.shift || 'Hello world.'
4 lang = ARGV.shift || 'en_fr'
5
6 require 'soap/driver'
7
8 server = 'http://services.xmethods.net/perl/soaplite.cgi'
9 InterfaceNS = 'urn:xmethodsBabelFish'
10 logger = nil            # Devel::Logger.new( STDERR )
11 wireDumpDev = nil       # STDERR
12 proxy = ENV[ 'HTTP_PROXY' ] || ENV[ 'http_proxy' ]
13
14 drv = SOAP::Driver.new( logger, $0, InterfaceNS, server, proxy )
15 drv.setWireDumpDev( wireDumpDev )
16 drv.addMethodWithSOAPAction( 'BabelFish', InterfaceNS + "#BabelFish", 'translationmode', 'sourcedata' )
17
18 p drv.BabelFish( lang, text )
Note: See TracBrowser for help on using the browser.