A fork of https://github.com/Synerty/SOAPpy-py3 This is a working tree till fixes get imported upstream.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

33 lines
889 B

  1. #!/usr/bin/env python
  2. ident = '$Id: BabelfishWSDLTest.py,v 1.1 2003/07/18 15:58:28 warnes Exp $'
  3. import os, re
  4. import sys
  5. sys.path.insert(1, "..")
  6. from SOAPpy import WSDL
  7. # Check for a web proxy definition in environment
  8. try:
  9. proxy_url=os.environ['http_proxy']
  10. phost, pport = re.search('http://([^:]+):([0-9]+)', proxy_url).group(1,2)
  11. proxy = "%s:%s" % (phost, pport)
  12. except:
  13. proxy = None
  14. server = WSDL.Proxy('http://www.xmethods.net/sd/2001/BabelFishService.wsdl',
  15. http_proxy=proxy)
  16. english = "Hi Friend!"
  17. print "Babelfish Translations"
  18. print "------------------------"
  19. print "English: '%s'" % english
  20. print "French: '%s'" % server.BabelFish('en_fr',english)
  21. print "Spanish: '%s'" % server.BabelFish('en_es',english)
  22. print "Italian: '%s'" % server.BabelFish('en_it',english)
  23. print "German: '%s'" % server.BabelFish('en_de',english)
  24. print "Done."