source: TI12-security/trunk/python/ndg.security.common/ndg/security/common/zsi/sessionmanager/SessionManager_services.py @ 4513

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI12-security/trunk/python/ndg.security.common/ndg/security/common/zsi/sessionmanager/SessionManager_services.py@4513
Revision 4513, 4.1 KB checked in by pjkersha, 11 years ago (diff)

Added local Session Manager call test to combined services unit tests.

Line 
1##################################################
2# SessionManager_services.py
3# generated by ZSI.generate.wsdl2python
4##################################################
5
6
7from SessionManager_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 SessionManagerServiceLocator:
16    SessionManager_address = "http://localhost:5000"
17    def getSessionManagerAddress(self):
18        return SessionManagerServiceLocator.SessionManager_address
19    def getSessionManager(self, url=None, **kw):
20        return SessionManagerBindingSOAP(url or SessionManagerServiceLocator.SessionManager_address, **kw)
21
22# Methods
23class SessionManagerBindingSOAP:
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 0x84fad6c>
32    def getSessionStatus(self, userDN,sessID):
33
34        request = getSessionStatusInputMsg()
35        request._userDN = userDN
36        request._sessID = sessID
37
38        kw = {}
39        # no input wsaction
40        self.binding.Send(None, None, request, soapaction="getSessionStatus", **kw)
41        # no output wsaction
42        response = self.binding.Receive(getSessionStatusOutputMsg.typecode)
43        isAlive = response._isAlive
44        return isAlive
45
46    # op: <ZSI.wstools.WSDLTools.Message instance at 0x850208c>
47    def connect(self, username,passphrase,createServerSess):
48
49        request = connectInputMsg()
50        request._username = username
51        request._passphrase = passphrase
52        request._createServerSess = createServerSess
53
54        kw = {}
55        # no input wsaction
56        self.binding.Send(None, None, request, soapaction="connect", **kw)
57        # no output wsaction
58        response = self.binding.Receive(connectOutputMsg.typecode)
59        userX509Cert = response._userX509Cert
60        userPriKey = response._userPriKey
61        issuingCert = response._issuingCert
62        sessID = response._sessID
63        return userX509Cert,userPriKey,issuingCert,sessID
64
65    # op: <ZSI.wstools.WSDLTools.Message instance at 0x8502c0c>
66    def disconnect(self, userX509Cert,sessID):
67
68        request = disconnectInputMsg()
69        request._userX509Cert = userX509Cert
70        request._sessID = sessID
71
72        kw = {}
73        # no input wsaction
74        self.binding.Send(None, None, request, soapaction="disconnect", **kw)
75        # no output wsaction
76        response = self.binding.Receive(disconnectOutputMsg.typecode)
77        return 
78
79    # op: <ZSI.wstools.WSDLTools.Message instance at 0x8502dac>
80    def getAttCert(self, userX509Cert,sessID,attAuthorityURI,reqRole,mapFromTrustedHosts,rtnExtAttCertList,extAttCert,extTrustedHost):
81
82        request = getAttCertInputMsg()
83        request._userX509Cert = userX509Cert
84        request._sessID = sessID
85        request._attAuthorityURI = attAuthorityURI
86        request._reqRole = reqRole
87        request._mapFromTrustedHosts = mapFromTrustedHosts
88        request._rtnExtAttCertList = rtnExtAttCertList
89        request._extAttCert = extAttCert
90        request._extTrustedHost = extTrustedHost
91
92        kw = {}
93        # no input wsaction
94        self.binding.Send(None, None, request, soapaction="getAttCert", **kw)
95        # no output wsaction
96        response = self.binding.Receive(getAttCertOutputMsg.typecode)
97        attCert = response._attCert
98        msg = response._msg
99        extAttCertOut = response._extAttCertOut
100        return attCert,msg,extAttCertOut
101
102getSessionStatusInputMsg = ns0.getSessionStatus_Dec().pyclass
103
104getSessionStatusOutputMsg = ns0.getSessionStatusResponse_Dec().pyclass
105
106connectInputMsg = ns0.connect_Dec().pyclass
107
108connectOutputMsg = ns0.connectResponse_Dec().pyclass
109
110disconnectInputMsg = ns0.disconnect_Dec().pyclass
111
112disconnectOutputMsg = ns0.disconnectResponse_Dec().pyclass
113
114getAttCertInputMsg = ns0.getAttCert_Dec().pyclass
115
116getAttCertOutputMsg = ns0.getAttCertResponse_Dec().pyclass
Note: See TracBrowser for help on using the repository browser.