Advertisement
LaurentG

Untitled

Aug 25th, 2011
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.86 KB | None | 0 0
  1. #!/usr/bin/python
  2. from suds.client import Client
  3. import logging
  4. logging.basicConfig(level=logging.INFO)
  5. logging.getLogger('suds.client').setLevel(logging.DEBUG)
  6. logging.getLogger('suds.transport').setLevel(logging.DEBUG)
  7. logging.getLogger('suds.xsd.schema').setLevel(logging.DEBUG)
  8. logging.getLogger('suds.wsdl').setLevel(logging.DEBUG)
  9. client = Client('http://localhost:8087/calculator/soap/description')
  10.  
  11. #result = client.service.add_many([1, 2, 3, 4, 5])
  12. #print "add_many:", result
  13.  
  14. a = client.factory.create('Complex')
  15. a.r = 1
  16. a.i = 0
  17.  
  18. b = client.factory.create('Complex')
  19. b.r = 0
  20. b.i = 1
  21.  
  22. client.set_options(retxml=True)
  23. if False:
  24.     try:
  25.         res_comp = client.service.add_complex(a, b)
  26.     except BaseException as x:
  27.         print x
  28.     print "got smth"
  29. res_comp = client.service.add_complex({'r':1, 'i':0}, {'r':0, 'i':1})
  30. print res_comp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement