File: echoClient.py

package info (click to toggle)
python-soappy 0.9.7-3
  • links: PTS
  • area: main
  • in suites: woody
  • size: 500 kB
  • ctags: 1,020
  • sloc: python: 7,572; makefile: 43; sh: 16
file content (36 lines) | stat: -rwxr-xr-x 824 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env python

# Copyright (c) 2001 actzero, inc. All rights reserved.

import sys

import SOAP

# Uncomment to see outgoing HTTP headers and SOAP and incoming SOAP.
#SOAP.Config.debug = 1

SOAP.Config.BuildWithNoType = 1
SOAP.Config.BuildWithNoNamespacePrefix = 1

if len(sys.argv) > 1 and sys.argv[1] == '-s':
    server = SOAP.SOAPProxy("https://localhost:9900")
else:
    server = SOAP.SOAPProxy("http://localhost:9900")

# Echo...

# ...in an object
print server.echo_ino("moo")

# ...in an object in an object
print server.prop.echo2("moo")

# ...with keyword arguments 
print server.echo_wkw(third = "three", first = "one", second = "two")

# ...with a context object
print server.echo_wc("moo")

# ...with a header
hd = SOAP.headerType(data = {"mystring": "Hello World"})
print server._hd(hd).echo_wc("moo")