1 | ################################################## |
---|
2 | # SessionMgr_services.py |
---|
3 | # generated by ZSI.generate.wsdl2python |
---|
4 | ################################################## |
---|
5 | |
---|
6 | |
---|
7 | from SessionMgr_services_types import * |
---|
8 | import urlparse, types |
---|
9 | from ZSI.TCcompound import ComplexType, Struct |
---|
10 | from ZSI import client |
---|
11 | import ZSI |
---|
12 | from ZSI.generate.pyclass import pyclass_type |
---|
13 | |
---|
14 | # Locator |
---|
15 | class SessionMgrServiceLocator: |
---|
16 | SessionMgr_address = "http://localhost:5000" |
---|
17 | def getSessionMgrAddress(self): |
---|
18 | return SessionMgrServiceLocator.SessionMgr_address |
---|
19 | def getSessionMgr(self, url=None, **kw): |
---|
20 | return SessionMgrBindingSOAP(url or SessionMgrServiceLocator.SessionMgr_address, **kw) |
---|
21 | |
---|
22 | # Methods |
---|
23 | class SessionMgrBindingSOAP: |
---|
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 0x84652ac> |
---|
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 0x84655ac> |
---|
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 | userCert = response._userCert |
---|
60 | userPriKey = response._userPriKey |
---|
61 | issuingCert = response._issuingCert |
---|
62 | sessID = response._sessID |
---|
63 | return userCert,userPriKey,issuingCert,sessID |
---|
64 | |
---|
65 | # op: <ZSI.wstools.WSDLTools.Message instance at 0x846d2cc> |
---|
66 | def disconnect(self, userCert,sessID): |
---|
67 | |
---|
68 | request = disconnectInputMsg() |
---|
69 | request._userCert = userCert |
---|
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 0x846d46c> |
---|
80 | def getAttCert(self, userCert,sessID,attAuthorityURI,attAuthorityCert,reqRole,mapFromTrustedHosts,rtnExtAttCertList,extAttCert,extTrustedHost): |
---|
81 | |
---|
82 | request = getAttCertInputMsg() |
---|
83 | request._userCert = userCert |
---|
84 | request._sessID = sessID |
---|
85 | request._attAuthorityURI = attAuthorityURI |
---|
86 | request._attAuthorityCert = attAuthorityCert |
---|
87 | request._reqRole = reqRole |
---|
88 | request._mapFromTrustedHosts = mapFromTrustedHosts |
---|
89 | request._rtnExtAttCertList = rtnExtAttCertList |
---|
90 | request._extAttCert = extAttCert |
---|
91 | request._extTrustedHost = extTrustedHost |
---|
92 | |
---|
93 | kw = {} |
---|
94 | # no input wsaction |
---|
95 | self.binding.Send(None, None, request, soapaction="getAttCert", **kw) |
---|
96 | # no output wsaction |
---|
97 | response = self.binding.Receive(getAttCertOutputMsg.typecode) |
---|
98 | attCert = response._attCert |
---|
99 | msg = response._msg |
---|
100 | extAttCertOut = response._extAttCertOut |
---|
101 | return attCert,msg,extAttCertOut |
---|
102 | |
---|
103 | # op: <ZSI.wstools.WSDLTools.Message instance at 0x846d5ec> |
---|
104 | def getX509Cert(self): |
---|
105 | |
---|
106 | request = getX509CertInputMsg() |
---|
107 | |
---|
108 | kw = {} |
---|
109 | # no input wsaction |
---|
110 | self.binding.Send(None, None, request, soapaction="getX509Cert", **kw) |
---|
111 | # no output wsaction |
---|
112 | response = self.binding.Receive(getX509CertOutputMsg.typecode) |
---|
113 | x509Cert = response._x509Cert |
---|
114 | return x509Cert |
---|
115 | |
---|
116 | getSessionStatusInputMsg = ns0.getSessionStatus_Dec().pyclass |
---|
117 | |
---|
118 | getSessionStatusOutputMsg = ns0.getSessionStatusResponse_Dec().pyclass |
---|
119 | |
---|
120 | connectInputMsg = ns0.connect_Dec().pyclass |
---|
121 | |
---|
122 | connectOutputMsg = ns0.connectResponse_Dec().pyclass |
---|
123 | |
---|
124 | disconnectInputMsg = ns0.disconnect_Dec().pyclass |
---|
125 | |
---|
126 | disconnectOutputMsg = ns0.disconnectResponse_Dec().pyclass |
---|
127 | |
---|
128 | getAttCertInputMsg = ns0.getAttCert_Dec().pyclass |
---|
129 | |
---|
130 | getAttCertOutputMsg = ns0.getAttCertResponse_Dec().pyclass |
---|
131 | |
---|
132 | getX509CertInputMsg = ns0.getX509Cert_Dec().pyclass |
---|
133 | |
---|
134 | getX509CertOutputMsg = ns0.getX509CertResponse_Dec().pyclass |
---|