source: TI12-security/trunk/python/ndg.security.server/ndg/security/server/SessionMgr/SessionMgr_services_server.py @ 2107

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI12-security/trunk/python/ndg.security.server/ndg/security/server/SessionMgr/SessionMgr_services_server.py@2107
Revision 2107, 13.2 KB checked in by pjkersha, 12 years ago (diff)

python/www/html/sessionMgr.wsdl,
python/ndg.security.server/ndg/security/server/SessionMgr/SessionMgr_services_server.py,
python/ndg.security.common/ndg/security/common/SessionMgr/SessionMgr_services.py,
python/www/html/attAuthority.wsdl,
python/ndg.security.server/ndg/security/server/AttAuthority/AttAuthority_services_server.py,
python/ndg.security.common/ndg/security/common/AttAuthority/AttAuthority_services.py:
Fixes for WebSphere? WSDL check - added targetNamespace attribute to xsd:schema element,
added 'wsdl' prefix to operation, part and message elements.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1##################################################
2# SessionMgr_services_server.py
3#      Generated by ZSI.generate.wsdl2dispatch.DelAuthServiceModuleWriter
4#
5##################################################
6
7from ndg.security.common.SessionMgr.SessionMgr_services import *
8from ZSI.ServiceContainer import ServiceSOAPBinding
9
10class SessionMgrService(ServiceSOAPBinding):
11    soapAction = {}
12    root = {}
13    _wsdl = """<?xml version=\"1.0\" ?>
14<wsdl:definitions name=\"SessionMgr\" targetNamespace=\"urn:ndg:security:sessionMgr\" xmlns=\"http://schemas.xmlsoap.org/wsdl/\" xmlns:http=\"http://schemas.xmlsoap.org/wsdl/http/\" xmlns:soap=\"http://schemas.xmlsoap.org/wsdl/soap/\" xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:tns=\"urn:ndg:security:sessionMgr\" xmlns:wsdl=\"http://schemas.xmlsoap.org/wsdl/\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">
15
16  <wsdl:types>
17    <xsd:schema targetNamespace=\"urn:ndg:security:sessionMgr\">
18      <xsd:element name=\"addUser\">
19        <xsd:complexType>
20          <xsd:sequence>
21            <xsd:element maxOccurs=\"1\" minOccurs=\"1\" name=\"username\" type=\"xsd:string\"/>
22            <xsd:element maxOccurs=\"1\" minOccurs=\"1\" name=\"passphrase\" type=\"xsd:string\"/>
23          </xsd:sequence>
24        </xsd:complexType>
25      </xsd:element>
26     
27      <xsd:element name=\"addUserResponse\">
28        <xsd:complexType/>
29      </xsd:element>
30
31      <xsd:element name=\"connect\">
32        <xsd:complexType>
33          <xsd:sequence>
34            <xsd:element maxOccurs=\"1\" minOccurs=\"1\" name=\"username\" type=\"xsd:string\"/>
35            <xsd:element maxOccurs=\"1\" minOccurs=\"1\" name=\"passphrase\" type=\"xsd:string\"/>
36                    <xsd:element maxOccurs=\"1\" minOccurs=\"1\" name=\"createServerSess\" type=\"xsd:boolean\"/>
37                    <xsd:element maxOccurs=\"1\" minOccurs=\"1\" name=\"getCookie\" type=\"xsd:boolean\"/>
38          </xsd:sequence>
39        </xsd:complexType>
40      </xsd:element>
41     
42      <xsd:element name=\"connectResponse\">
43        <xsd:complexType>
44                  <xsd:sequence>
45                    <xsd:element maxOccurs=\"1\" minOccurs=\"1\" name=\"proxyCert\" type=\"xsd:string\"/>
46                    <xsd:element maxOccurs=\"1\" minOccurs=\"1\" name=\"proxyPriKey\" type=\"xsd:string\"/>
47                    <xsd:element maxOccurs=\"1\" minOccurs=\"1\" name=\"userCert\" type=\"xsd:string\"/>
48                    <xsd:element maxOccurs=\"1\" minOccurs=\"0\" name=\"cookie\" type=\"xsd:string\"/>
49                  </xsd:sequence>
50                </xsd:complexType>
51      </xsd:element>
52
53      <xsd:element name=\"disconnect\">
54        <xsd:complexType>
55                  <xsd:sequence>
56                    <xsd:element maxOccurs=\"1\" minOccurs=\"0\" name=\"userCert\" type=\"xsd:string\"/>
57                    <xsd:element maxOccurs=\"1\" minOccurs=\"0\" name=\"sessID\" type=\"xsd:string\"/>
58                    <xsd:element maxOccurs=\"1\" minOccurs=\"0\" name=\"encrSessionMgrURI\" type=\"xsd:string\"/>
59                  </xsd:sequence>
60                </xsd:complexType>
61      </xsd:element>
62
63      <xsd:element name=\"disconnectResponse\">
64        <xsd:complexType/>
65      </xsd:element>
66           
67      <xsd:element name=\"getAttCert\">
68        <xsd:complexType>
69                  <xsd:sequence>
70                    <xsd:element maxOccurs=\"1\" minOccurs=\"0\" name=\"userCert\" type=\"xsd:string\"/>
71                    <xsd:element maxOccurs=\"1\" minOccurs=\"0\" name=\"sessID\" type=\"xsd:string\"/>
72                    <xsd:element maxOccurs=\"1\" minOccurs=\"0\" name=\"encrSessionMgrURI\" type=\"xsd:string\"/>
73                    <xsd:element maxOccurs=\"1\" minOccurs=\"1\" name=\"attAuthorityURI\" type=\"xsd:string\"/>
74                    <xsd:element maxOccurs=\"1\" minOccurs=\"0\" name=\"attAuthorityCert\" type=\"xsd:string\"/>
75                    <xsd:element maxOccurs=\"1\" minOccurs=\"0\" name=\"reqRole\" type=\"xsd:string\"/>
76                    <xsd:element maxOccurs=\"1\" minOccurs=\"1\" name=\"mapFromTrustedHosts\" type=\"xsd:boolean\"/>
77                    <xsd:element maxOccurs=\"1\" minOccurs=\"1\" name=\"rtnExtAttCertList\" type=\"xsd:boolean\"/>
78                        <xsd:element maxOccurs=\"unbounded\" minOccurs=\"0\" name=\"extAttCert\" type=\"xsd:string\"/>
79                        <xsd:element maxOccurs=\"unbounded\" minOccurs=\"0\" name=\"extTrustedHost\" type=\"xsd:string\"/>
80                  </xsd:sequence>
81                </xsd:complexType>
82      </xsd:element>
83     
84      <xsd:element name=\"getAttCertResponse\">
85        <xsd:complexType>
86              <xsd:sequence>
87                <xsd:element maxOccurs=\"1\" minOccurs=\"0\" name=\"attCert\" type=\"xsd:string\"/>
88                <xsd:element maxOccurs=\"1\" minOccurs=\"0\" name=\"msg\" type=\"xsd:string\"/>
89                        <xsd:element maxOccurs=\"unbounded\" minOccurs=\"0\" name=\"extAttCert\" type=\"xsd:string\"/>
90              </xsd:sequence>
91            </xsd:complexType>
92      </xsd:element>
93
94      <xsd:element name=\"getX509Cert\">
95        <xsd:complexType/>
96      </xsd:element>
97     
98      <xsd:element name=\"getX509CertResponse\">
99        <xsd:complexType>
100                  <xsd:sequence>
101                    <xsd:element maxOccurs=\"1\" minOccurs=\"1\" name=\"x509Cert\" type=\"xsd:string\"/>
102                  </xsd:sequence>
103                </xsd:complexType>
104      </xsd:element>
105
106    </xsd:schema>
107  </wsdl:types>
108 
109  <wsdl:message name=\"addUserInputMsg\">
110    <wsdl:part element=\"tns:addUser\" name=\"parameters\"/>
111  </wsdl:message>
112
113  <wsdl:message name=\"addUserOutputMsg\">
114    <wsdl:part element=\"tns:addUserResponse\" name=\"parameters\"/>
115  </wsdl:message>
116 
117  <wsdl:message name=\"connectInputMsg\">
118    <wsdl:part element=\"tns:connect\" name=\"parameters\"/>
119  </wsdl:message>
120
121  <wsdl:message name=\"connectOutputMsg\">
122    <wsdl:part element=\"tns:connectResponse\" name=\"parameters\"/>
123  </wsdl:message>
124 
125  <wsdl:message name=\"disconnectInputMsg\">
126    <wsdl:part element=\"tns:disconnect\" name=\"parameters\"/>
127  </wsdl:message>
128
129  <wsdl:message name=\"disconnectOutputMsg\">
130    <wsdl:part element=\"tns:disconnectResponse\" name=\"parameters\"/>
131  </wsdl:message>
132
133  <wsdl:message name=\"getAttCertInputMsg\">
134    <wsdl:part element=\"tns:getAttCert\" name=\"parameters\"/>
135  </wsdl:message>
136
137  <wsdl:message name=\"getAttCertOutputMsg\">
138    <wsdl:part element=\"tns:getAttCertResponse\" name=\"parameters\"/>
139  </wsdl:message>
140
141  <wsdl:message name=\"getX509CertInputMsg\">
142    <wsdl:part element=\"tns:getX509Cert\" name=\"parameters\"/>
143  </wsdl:message>
144
145  <wsdl:message name=\"getX509CertOutputMsg\">
146    <wsdl:part element=\"tns:getX509CertResponse\" name=\"parameters\"/>
147  </wsdl:message>
148
149  <wsdl:portType name=\"SessionMgr\">
150    <wsdl:operation name=\"addUser\">
151      <wsdl:input message=\"tns:addUserInputMsg\"/>
152      <wsdl:output message=\"tns:addUserOutputMsg\"/>
153    </wsdl:operation>
154
155    <wsdl:operation name=\"connect\">
156      <wsdl:input message=\"tns:connectInputMsg\"/>
157      <wsdl:output message=\"tns:connectOutputMsg\"/>
158    </wsdl:operation>
159
160    <wsdl:operation name=\"disconnect\">
161      <wsdl:input message=\"tns:disconnectInputMsg\"/>
162      <wsdl:output message=\"tns:disconnectOutputMsg\"/>
163    </wsdl:operation>
164
165    <wsdl:operation name=\"getAttCert\">
166      <wsdl:input message=\"tns:getAttCertInputMsg\"/>
167      <wsdl:output message=\"tns:getAttCertOutputMsg\"/>
168    </wsdl:operation>
169
170    <wsdl:operation name=\"getX509Cert\">
171      <wsdl:input message=\"tns:getX509CertInputMsg\"/>
172      <wsdl:output message=\"tns:getX509CertOutputMsg\"/>
173    </wsdl:operation>
174  </wsdl:portType> 
175 
176  <wsdl:binding name=\"SessionMgrBinding\" type=\"tns:SessionMgr\">
177    <soap:binding style=\"document\" transport=\"http://schemas.xmlsoap.org/soap/http\"/>
178
179    <wsdl:operation name=\"addUser\">
180      <soap:operation soapAction=\"addUser\"/>
181      <wsdl:input>
182        <soap:body use=\"literal\"/>
183      </wsdl:input>
184      <wsdl:output>
185        <soap:body use=\"literal\"/>
186      </wsdl:output>
187    </wsdl:operation>
188   
189    <wsdl:operation name=\"connect\">
190      <soap:operation soapAction=\"connect\"/>
191      <wsdl:input>
192        <soap:body use=\"literal\"/>
193      </wsdl:input>
194      <wsdl:output>
195        <soap:body use=\"literal\"/>
196      </wsdl:output>
197    </wsdl:operation>
198   
199    <wsdl:operation name=\"disconnect\">
200      <soap:operation soapAction=\"disconnect\"/>
201      <wsdl:input>
202        <soap:body use=\"literal\"/>
203      </wsdl:input>
204      <wsdl:output>
205        <soap:body use=\"literal\"/>
206      </wsdl:output>
207    </wsdl:operation>
208   
209    <wsdl:operation name=\"getAttCert\">
210      <soap:operation soapAction=\"getAttCert\"/>
211      <wsdl:input>
212        <soap:body use=\"literal\"/>
213      </wsdl:input>
214      <wsdl:output>
215        <soap:body use=\"literal\"/>
216      </wsdl:output>
217    </wsdl:operation>
218
219    <wsdl:operation name=\"getX509Cert\">
220      <soap:operation soapAction=\"getX509Cert\"/>
221      <wsdl:input>
222        <soap:body use=\"literal\"/>
223      </wsdl:input>
224      <wsdl:output>
225        <soap:body use=\"literal\"/>
226      </wsdl:output>
227    </wsdl:operation>   
228 
229  </wsdl:binding>
230
231  <wsdl:service name=\"SessionMgrService\">
232    <wsdl:documentation>NERC Data Grid Session Manager web service</wsdl:documentation>
233    <wsdl:port binding=\"tns:SessionMgrBinding\" name=\"SessionMgr\">
234      <soap:address location=\"http://localhost:5000\"/>
235    </wsdl:port>
236  </wsdl:service>
237</wsdl:definitions>"""
238
239    def __init__(self, post='', **kw):
240        ServiceSOAPBinding.__init__(self, post)
241        if kw.has_key('impl'):
242            self.impl = kw['impl']
243        self.auth_method_name = None
244        if kw.has_key('auth_method_name'):
245            self.auth_method_name = kw['auth_method_name']
246    def authorize(self, auth_info, post, action):
247        if self.auth_method_name and hasattr(self.impl, self.auth_method_name):
248            return getattr(self.impl, self.auth_method_name)(auth_info, post, action)
249        else:
250            return 1
251
252    def soap_addUser(self, ps):
253        self.request = ps.Parse(addUserInputMsg.typecode)
254        parameters = (self.request._username, self.request._passphrase)
255
256        # If we have an implementation object use it
257        if hasattr(self,'impl'):
258            parameters = self.impl.addUser(parameters[0],parameters[1])
259
260        result = addUserOutputMsg()
261        return self.request, result
262
263    soapAction['addUser'] = 'soap_addUser'
264    root[(addUserInputMsg.typecode.nspname,addUserInputMsg.typecode.pname)] = 'soap_addUser'
265
266    def soap_connect(self, ps):
267        self.request = ps.Parse(connectInputMsg.typecode)
268        parameters = (self.request._username, self.request._passphrase, self.request._createServerSess, self.request._getCookie)
269
270        # If we have an implementation object use it
271        if hasattr(self,'impl'):
272            parameters = self.impl.connect(parameters[0],parameters[1],parameters[2],parameters[3])
273
274        result = connectOutputMsg()
275        # If we have an implementation object, copy the result
276        if hasattr(self,'impl'):
277            # Should have a tuple of 4 args
278            result._proxyCert = parameters[0]
279            result._proxyPriKey = parameters[1]
280            result._userCert = parameters[2]
281            result._cookie = parameters[3]
282        return self.request, result
283
284    soapAction['connect'] = 'soap_connect'
285    root[(connectInputMsg.typecode.nspname,connectInputMsg.typecode.pname)] = 'soap_connect'
286
287    def soap_disconnect(self, ps):
288        self.request = ps.Parse(disconnectInputMsg.typecode)
289        parameters = (self.request._userCert, self.request._sessID, self.request._encrSessionMgrURI)
290
291        # If we have an implementation object use it
292        if hasattr(self,'impl'):
293            parameters = self.impl.disconnect(parameters[0],parameters[1],parameters[2])
294
295        result = disconnectOutputMsg()
296        return self.request, result
297
298    soapAction['disconnect'] = 'soap_disconnect'
299    root[(disconnectInputMsg.typecode.nspname,disconnectInputMsg.typecode.pname)] = 'soap_disconnect'
300
301    def soap_getAttCert(self, ps):
302        self.request = ps.Parse(getAttCertInputMsg.typecode)
303        parameters = (self.request._userCert, self.request._sessID, self.request._encrSessionMgrURI, self.request._attAuthorityURI, self.request._attAuthorityCert, self.request._reqRole, self.request._mapFromTrustedHosts, self.request._rtnExtAttCertList, self.request._extAttCert, self.request._extTrustedHost)
304
305        # If we have an implementation object use it
306        if hasattr(self,'impl'):
307            parameters = self.impl.getAttCert(parameters[0],parameters[1],parameters[2],parameters[3],parameters[4],parameters[5],parameters[6],parameters[7],parameters[8],parameters[9])
308
309        result = getAttCertOutputMsg()
310        # If we have an implementation object, copy the result
311        if hasattr(self,'impl'):
312            # Should have a tuple of 3 args
313            result._attCert = parameters[0]
314            result._msg = parameters[1]
315            result._extAttCert = parameters[2]
316        return self.request, result
317
318    soapAction['getAttCert'] = 'soap_getAttCert'
319    root[(getAttCertInputMsg.typecode.nspname,getAttCertInputMsg.typecode.pname)] = 'soap_getAttCert'
320
321    def soap_getX509Cert(self, ps):
322        self.request = ps.Parse(getX509CertInputMsg.typecode)
323
324        # If we have an implementation object use it
325        if hasattr(self,'impl'):
326            parameters = self.impl.getX509Cert()
327
328        result = getX509CertOutputMsg()
329        # If we have an implementation object, copy the result
330        if hasattr(self,'impl'):
331            result._x509Cert = parameters
332        return self.request, result
333
334    soapAction['getX509Cert'] = 'soap_getX509Cert'
335    root[(getX509CertInputMsg.typecode.nspname,getX509CertInputMsg.typecode.pname)] = 'soap_getX509Cert'
336
Note: See TracBrowser for help on using the repository browser.