Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 30th, 2012  |  syntax: None  |  size: 0.75 KB  |  hits: 13  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. from suds.client import Client
  2. import logging
  3.  
  4. logging.basicConfig(level=logging.INFO)
  5. logging.getLogger('suds.transport').setLevel(logging.DEBUG)
  6.  
  7.  
  8. class DBio(object):
  9.  
  10.     def __init__(self):
  11.         self._client = Client('http://localhost:7789/?wsdl')
  12.  
  13.     def send_values(self, values):
  14.         array_of_strings = self._client.factory.create('stringArray')
  15.         array_of_strings.string.extend(values)
  16.         self._client.service.write_values(array_of_strings)
  17.  
  18.     def recieve_value(self, index):
  19.         return self._client.service.read_value(index)
  20.  
  21. VALUES = [["Nekdo"],
  22.         ["Neco"],
  23.         ["Necojineho"]]
  24.  
  25.  
  26. if __name__ == '__main__':
  27.     client = DBio()
  28.     client.send_values(VALUES)
  29.     print client.recieve_value(0)
  30.     print client.recieve_value(9)