source: TI12-security/trunk/python/ndg.security.test/ndg/security/test/wsSecurity/client/Echo_services.py @ 3115

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI12-security/trunk/python/ndg.security.test/ndg/security/test/wsSecurity/client/Echo_services.py@3115
Revision 3115, 2.0 KB checked in by pjkersha, 12 years ago (diff)

security/python/ndg.security.test/ndg/security/test/wsSecurity/client: converting into unit test

Line 
1##################################################
2# EchoServer_services.py
3# generated by ZSI.generate.wsdl2python
4##################################################
5
6
7from EchoServer_services_types import *
8import urlparse, types
9from ZSI.TCcompound import ComplexType, Struct
10from ZSI import client
11import ZSI
12from ZSI.generate.pyclass import pyclass_type
13
14# Locator
15class EchoServerLocator:
16    EchoServer_address = "http://localhost:7100"
17    def getEchoServerAddress(self):
18        return EchoServerLocator.EchoServer_address
19    def getEchoServer(self, url=None, **kw):
20        return EchoServerSOAP(url or EchoServerLocator.EchoServer_address, **kw)
21
22# Methods
23class EchoServerSOAP:
24    def __init__(self, url, **kw):
25        kw.setdefault("readerclass", None)
26        kw.setdefault("writerclass", None)
27        # no resource properties
28        self.binding = client.Binding(url=url, **kw)
29        # no ws-addressing
30
31    # op: <ZSI.wstools.WSDLTools.Message instance at 0x4070322c>
32    def Echo(self, EchoIn):
33
34        request = EchoRequest()
35        request._EchoIn = EchoIn
36
37        kw = {}
38        # no input wsaction
39        self.binding.Send(None, None, request, soapaction="Echo", **kw)
40        # no output wsaction
41        response = self.binding.Receive(EchoResponse.typecode)
42        EchoResult = response._EchoResult
43        return EchoResult
44
45    # op: <ZSI.wstools.WSDLTools.Message instance at 0x40703a0c>
46    def EchoEncr(self, EchoIn):
47
48        request = EchoEncrRequest()
49        request._EchoIn = EchoIn
50
51        kw = {}
52        # no input wsaction
53        self.binding.Send(None, None, request, soapaction="EchoEncr", **kw)
54        # no output wsaction
55        response = self.binding.Receive(EchoEncrResponse.typecode)
56        EchoResult = response._EchoResult
57        return EchoResult
58
59EchoRequest = ns0.Echo_Dec().pyclass
60
61EchoResponse = ns0.EchoResponse_Dec().pyclass
62
63EchoEncrRequest = ns0.EchoEncr_Dec().pyclass
64
65EchoEncrResponse = ns0.EchoEncrResponse_Dec().pyclass
Note: See TracBrowser for help on using the repository browser.