source: TI12-security/trunk/python/ndg.security.server/ndg/security/server/AttAuthority/AttAuthority_services_server.py @ 2107

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI12-security/trunk/python/ndg.security.server/ndg/security/server/AttAuthority/AttAuthority_services_server.py@2107
Revision 2107, 10.4 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# AttAuthority_services_server.py
3#      Generated by ZSI.generate.wsdl2dispatch.DelAuthServiceModuleWriter
4#
5##################################################
6
7from ndg.security.common.AttAuthority.AttAuthority_services import *
8from ZSI.ServiceContainer import ServiceSOAPBinding
9
10class AttAuthorityService(ServiceSOAPBinding):
11    soapAction = {}
12    root = {}
13    _wsdl = """<?xml version=\"1.0\" ?>
14<wsdl:definitions name=\"AttAuthority\" targetNamespace=\"urn:ndg:security:attAuthority\" 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:attAuthority\" 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:attAuthority\">
18   
19      <xsd:complexType name=\"HostInfo\">
20        <xsd:sequence>
21          <xsd:element maxOccurs=\"1\" minOccurs=\"1\" name=\"hostname\" type=\"xsd:string\"/>
22          <xsd:element maxOccurs=\"1\" minOccurs=\"1\" name=\"aaURI\" type=\"xsd:string\"/>
23          <xsd:element maxOccurs=\"1\" minOccurs=\"1\" name=\"loginURI\" type=\"xsd:string\"/>
24          <xsd:element maxOccurs=\"unbounded\" minOccurs=\"0\" name=\"roleList\" type=\"xsd:string\"/>
25        </xsd:sequence>
26      </xsd:complexType>
27     
28      <xsd:element name=\"getAttCert\">
29        <xsd:complexType>
30          <xsd:sequence>
31            <xsd:element maxOccurs=\"1\" minOccurs=\"0\" name=\"userCert\" type=\"xsd:string\"/>
32            <xsd:element maxOccurs=\"1\" minOccurs=\"0\" name=\"userAttCert\" type=\"xsd:string\"/>
33          </xsd:sequence>
34        </xsd:complexType>
35      </xsd:element>
36     
37      <xsd:element name=\"getAttCertResponse\">
38        <xsd:complexType>
39          <xsd:sequence>
40            <xsd:element maxOccurs=\"1\" minOccurs=\"0\" name=\"attCert\" type=\"xsd:string\"/>
41                <xsd:element maxOccurs=\"1\" minOccurs=\"0\" name=\"msg\" type=\"xsd:string\"/>
42          </xsd:sequence>
43        </xsd:complexType>
44      </xsd:element>
45
46      <xsd:element name=\"getHostInfo\">
47        <xsd:complexType/>
48      </xsd:element>
49
50      <xsd:element name=\"getHostInfoResponse\">
51        <xsd:complexType>
52          <xsd:sequence>
53            <xsd:element maxOccurs=\"1\" minOccurs=\"1\" name=\"hostname\" type=\"xsd:string\"/>
54            <xsd:element maxOccurs=\"1\" minOccurs=\"1\" name=\"aaURI\" type=\"xsd:string\"/>
55            <xsd:element maxOccurs=\"1\" minOccurs=\"1\" name=\"loginURI\" type=\"xsd:string\"/>
56          </xsd:sequence>
57        </xsd:complexType>
58      </xsd:element>
59
60      <xsd:element name=\"getTrustedHostInfo\">
61        <xsd:complexType>
62          <xsd:sequence>
63            <xsd:element maxOccurs=\"1\" minOccurs=\"0\" name=\"role\" type=\"xsd:string\"/>
64          </xsd:sequence>
65        </xsd:complexType>
66      </xsd:element>
67
68      <xsd:element name=\"getTrustedHostInfoResponse\">
69        <xsd:complexType>
70          <xsd:sequence>
71            <xsd:element maxOccurs=\"unbounded\" minOccurs=\"0\" name=\"trustedHosts\" type=\"tns:HostInfo\"/>
72          </xsd:sequence>
73        </xsd:complexType>
74      </xsd:element>
75
76      <xsd:element name=\"getX509Cert\">
77        <xsd:complexType/>
78      </xsd:element>
79     
80      <xsd:element name=\"getX509CertResponse\">
81        <xsd:complexType>
82          <xsd:sequence>
83            <xsd:element maxOccurs=\"1\" minOccurs=\"1\" name=\"x509Cert\" type=\"xsd:string\"/>
84          </xsd:sequence>
85        </xsd:complexType>
86      </xsd:element>
87
88    </xsd:schema>
89  </wsdl:types>
90 
91  <wsdl:message name=\"getAttCertInputMsg\">
92    <wsdl:part element=\"tns:getAttCert\" name=\"parameters\"/>
93  </wsdl:message>
94
95  <wsdl:message name=\"getAttCertOutputMsg\">
96    <wsdl:part element=\"tns:getAttCertResponse\" name=\"parameters\"/>
97  </wsdl:message>
98 
99  <wsdl:message name=\"getHostInfoInputMsg\">
100    <wsdl:part element=\"tns:getHostInfo\" name=\"parameters\"/>
101  </wsdl:message>
102
103  <wsdl:message name=\"getHostInfoOutputMsg\">
104    <wsdl:part element=\"tns:getHostInfoResponse\" name=\"parameters\"/>
105  </wsdl:message>
106
107  <wsdl:message name=\"getTrustedHostInfoInputMsg\">
108    <wsdl:part element=\"tns:getTrustedHostInfo\" name=\"parameters\"/>
109  </wsdl:message>
110
111  <wsdl:message name=\"getTrustedHostInfoOutputMsg\">
112    <wsdl:part element=\"tns:getTrustedHostInfoResponse\" name=\"parameters\"/>
113  </wsdl:message>
114
115  <wsdl:message name=\"getX509CertInputMsg\">
116    <wsdl:part element=\"tns:getX509Cert\" name=\"parameters\"/>
117  </wsdl:message>
118
119  <wsdl:message name=\"getX509CertOutputMsg\">
120    <wsdl:part element=\"tns:getX509CertResponse\" name=\"parameters\"/>
121  </wsdl:message>
122
123  <wsdl:portType name=\"AttAuthority\">
124    <wsdl:operation name=\"getAttCert\">
125      <wsdl:input message=\"tns:getAttCertInputMsg\"/>
126      <wsdl:output message=\"tns:getAttCertOutputMsg\"/>
127    </wsdl:operation>
128
129    <wsdl:operation name=\"getHostInfo\">
130      <wsdl:input message=\"tns:getHostInfoInputMsg\"/>
131      <wsdl:output message=\"tns:getHostInfoOutputMsg\"/>
132    </wsdl:operation>
133
134    <wsdl:operation name=\"getTrustedHostInfo\">
135      <wsdl:input message=\"tns:getTrustedHostInfoInputMsg\"/>
136      <wsdl:output message=\"tns:getTrustedHostInfoOutputMsg\"/>
137    </wsdl:operation>
138
139    <wsdl:operation name=\"getX509Cert\">
140      <wsdl:input message=\"tns:getX509CertInputMsg\"/>
141      <wsdl:output message=\"tns:getX509CertOutputMsg\"/>
142    </wsdl:operation>
143  </wsdl:portType>
144
145  <wsdl:binding name=\"AttAuthorityBinding\" type=\"tns:AttAuthority\">
146    <soap:binding style=\"document\" transport=\"http://schemas.xmlsoap.org/soap/http\"/>
147     
148    <wsdl:operation name=\"getAttCert\">
149      <soap:operation soapAction=\"getAttCert\"/>
150      <wsdl:input>
151        <soap:body use=\"literal\"/>
152      </wsdl:input>
153      <wsdl:output>
154        <soap:body use=\"literal\"/>
155      </wsdl:output>
156    </wsdl:operation>
157
158    <wsdl:operation name=\"getHostInfo\">
159      <soap:operation soapAction=\"getHostInfo\"/>
160      <wsdl:input>
161        <soap:body use=\"literal\"/>
162      </wsdl:input>
163      <wsdl:output>
164        <soap:body use=\"literal\"/>
165      </wsdl:output>
166    </wsdl:operation>
167
168    <wsdl:operation name=\"getTrustedHostInfo\">
169      <soap:operation soapAction=\"getTrustedHostInfo\"/>
170      <wsdl:input>
171        <soap:body use=\"literal\"/>
172      </wsdl:input>
173      <wsdl:output>
174        <soap:body use=\"literal\"/>
175      </wsdl:output>
176    </wsdl:operation>
177
178    <wsdl:operation name=\"getX509Cert\">
179      <soap:operation soapAction=\"getX509Cert\"/>
180      <wsdl:input>
181        <soap:body use=\"literal\"/>
182      </wsdl:input>
183      <wsdl:output>
184        <soap:body use=\"literal\"/>
185      </wsdl:output>
186    </wsdl:operation>   
187 
188  </wsdl:binding>
189
190  <wsdl:service name=\"AttAuthorityService\">
191    <wsdl:documentation>NERC Data Grid Attribute Authority web service</wsdl:documentation>
192    <wsdl:port binding=\"tns:AttAuthorityBinding\" name=\"AttAuthority\">
193      <soap:address location=\"http://localhost:5700\"/>
194    </wsdl:port>
195  </wsdl:service>
196</wsdl:definitions>"""
197
198    def __init__(self, post='', **kw):
199        ServiceSOAPBinding.__init__(self, post)
200        if kw.has_key('impl'):
201            self.impl = kw['impl']
202        self.auth_method_name = None
203        if kw.has_key('auth_method_name'):
204            self.auth_method_name = kw['auth_method_name']
205    def authorize(self, auth_info, post, action):
206        if self.auth_method_name and hasattr(self.impl, self.auth_method_name):
207            return getattr(self.impl, self.auth_method_name)(auth_info, post, action)
208        else:
209            return 1
210
211    def soap_getAttCert(self, ps):
212        self.request = ps.Parse(getAttCertInputMsg.typecode)
213        parameters = (self.request._userCert, self.request._userAttCert)
214
215        # If we have an implementation object use it
216        if hasattr(self,'impl'):
217            parameters = self.impl.getAttCert(parameters[0],parameters[1])
218
219        result = getAttCertOutputMsg()
220        # If we have an implementation object, copy the result
221        if hasattr(self,'impl'):
222            # Should have a tuple of 2 args
223            result._attCert = parameters[0]
224            result._msg = parameters[1]
225        return self.request, result
226
227    soapAction['getAttCert'] = 'soap_getAttCert'
228    root[(getAttCertInputMsg.typecode.nspname,getAttCertInputMsg.typecode.pname)] = 'soap_getAttCert'
229
230    def soap_getHostInfo(self, ps):
231        self.request = ps.Parse(getHostInfoInputMsg.typecode)
232
233        # If we have an implementation object use it
234        if hasattr(self,'impl'):
235            parameters = self.impl.getHostInfo()
236
237        result = getHostInfoOutputMsg()
238        # If we have an implementation object, copy the result
239        if hasattr(self,'impl'):
240            # Should have a tuple of 3 args
241            result._hostname = parameters[0]
242            result._aaURI = parameters[1]
243            result._loginURI = parameters[2]
244        return self.request, result
245
246    soapAction['getHostInfo'] = 'soap_getHostInfo'
247    root[(getHostInfoInputMsg.typecode.nspname,getHostInfoInputMsg.typecode.pname)] = 'soap_getHostInfo'
248
249    def soap_getTrustedHostInfo(self, ps):
250        self.request = ps.Parse(getTrustedHostInfoInputMsg.typecode)
251        parameters = self.request._role
252
253        # If we have an implementation object use it
254        if hasattr(self,'impl'):
255            parameters = self.impl.getTrustedHostInfo(parameters)
256
257        result = getTrustedHostInfoOutputMsg()
258        # If we have an implementation object, copy the result
259        if hasattr(self,'impl'):
260            result._trustedHosts = parameters
261        return self.request, result
262
263    soapAction['getTrustedHostInfo'] = 'soap_getTrustedHostInfo'
264    root[(getTrustedHostInfoInputMsg.typecode.nspname,getTrustedHostInfoInputMsg.typecode.pname)] = 'soap_getTrustedHostInfo'
265
266    def soap_getX509Cert(self, ps):
267        self.request = ps.Parse(getX509CertInputMsg.typecode)
268
269        # If we have an implementation object use it
270        if hasattr(self,'impl'):
271            parameters = self.impl.getX509Cert()
272
273        result = getX509CertOutputMsg()
274        # If we have an implementation object, copy the result
275        if hasattr(self,'impl'):
276            result._x509Cert = parameters
277        return self.request, result
278
279    soapAction['getX509Cert'] = 'soap_getX509Cert'
280    root[(getX509CertInputMsg.typecode.nspname,getX509CertInputMsg.typecode.pname)] = 'soap_getX509Cert'
281
Note: See TracBrowser for help on using the repository browser.