source: TI12-security/trunk/NDGSecurity/python/Tests/dewsGatekeeper/Gatekeeper_services_server.py @ 7080

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI12-security/trunk/NDGSecurity/python/Tests/dewsGatekeeper/Gatekeeper_services_server.py@7080
Revision 7080, 4.0 KB checked in by pjkersha, 9 years ago (diff)
  • Property svn:keywords set to Id
Line 
1##################################################
2# Gatekeeper_services_server.py
3#      Generated by ZSI.generate.wsdl2dispatch.DelAuthServiceModuleWriter
4#
5##################################################
6
7from Gatekeeper_services import *
8from ZSI.ServiceContainer import ServiceSOAPBinding
9
10class GatekeeperService(ServiceSOAPBinding):
11    soapAction = {}
12    root = {}
13    _wsdl = """<?xml version=\"1.0\" ?>
14<wsdl:definitions name=\"Gatekeeper\" targetNamespace=\"ndg:security:Gatekeeper\" 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=\"ndg:security:Gatekeeper\" xmlns:wsdl=\"http://schemas.xmlsoap.org/wsdl/\" xmlns:wsu=\"http://schemas.xmlsoap.org/ws/2002/07/utility\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">
15
16  <wsdl:types>
17    <xsd:schema>
18      <xsd:element name=\"get\">
19        <xsd:complexType>
20          <xsd:sequence>
21            <xsd:element maxOccurs=\"1\" minOccurs=\"1\" name=\"userX509Cert\" type=\"xsd:string\"/>
22            <xsd:element maxOccurs=\"1\" minOccurs=\"1\" name=\"userAttributeCertificate\" type=\"xsd:string\"/>
23            <xsd:element maxOccurs=\"1\" minOccurs=\"1\" name=\"geoserverRequest\" type=\"xsd:string\"/>
24          </xsd:sequence>
25        </xsd:complexType>
26      </xsd:element>
27      <xsd:element name=\"getResponse\">
28        <xsd:complexType>
29                  <xsd:sequence>
30                <xsd:element maxOccurs=\"1\" minOccurs=\"1\" name=\"geoServerResponse\" type=\"xsd:string\"/>
31                  </xsd:sequence>
32                </xsd:complexType>
33      </xsd:element>
34    </xsd:schema>
35  </wsdl:types>
36
37  <wsdl:message name=\"getInputMsg\">
38    <wsdl:part element=\"get\" name=\"parameters\"/>
39  </wsdl:message>
40
41  <wsdl:message name=\"getOutputMsg\">
42    <wsdl:part element=\"getResponse\" name=\"parameters\"/>
43  </wsdl:message>
44
45  <wsdl:portType name=\"Gatekeeper\">
46    <wsdl:operation name=\"get\">
47      <wsdl:input message=\"tns:getInputMsg\"/>
48      <wsdl:output message=\"tns:getOutputMsg\"/>
49    </wsdl:operation>
50  </wsdl:portType>
51
52  <wsdl:binding name=\"GatekeeperBinding\" type=\"tns:Gatekeeper\">
53    <soap:binding style=\"document\" transport=\"http://schemas.xmlsoap.org/soap/http\"/>
54    <wsdl:operation name=\"get\">
55      <soap:operation soapAction=\"get\"/>
56      <wsdl:input>
57        <soap:body use=\"literal\"/>
58      </wsdl:input>
59      <wsdl:output>
60        <soap:body use=\"literal\"/>
61      </wsdl:output>
62    </wsdl:operation>
63  </wsdl:binding>
64
65  <wsdl:service name=\"GatekeeperService\">
66    <wsdl:documentation>DEWS Gatekeeper web service</wsdl:documentation>
67    <wsdl:port binding=\"tns:GatekeeperBinding\" name=\"Gatekeeper\">
68      <soap:address location=\"http://localhost:5000\"/>
69    </wsdl:port>
70  </wsdl:service>
71</wsdl:definitions>"""
72
73    def __init__(self, post='', **kw):
74        ServiceSOAPBinding.__init__(self, post)
75        if kw.has_key('impl'):
76            self.impl = kw['impl']
77        self.auth_method_name = None
78        if kw.has_key('auth_method_name'):
79            self.auth_method_name = kw['auth_method_name']
80    def authorize(self, auth_info, post, action):
81        if self.auth_method_name and hasattr(self.impl, self.auth_method_name):
82            return getattr(self.impl, self.auth_method_name)(auth_info, post, action)
83        else:
84            return 1
85
86    def soap_get(self, ps):
87        self.request = ps.Parse(getInputMsg.typecode)
88        parameters = (self.request._userX509Cert, self.request._userAttributeCertificate, self.request._geoserverRequest)
89
90        # If we have an implementation object use it
91        if hasattr(self,'impl'):
92            parameters = self.impl.get(parameters[0],parameters[1],parameters[2])
93
94        result = getOutputMsg()
95        # If we have an implementation object, copy the result
96        if hasattr(self,'impl'):
97            result._geoServerResponse = parameters
98        return result
99
100    soapAction['get'] = 'soap_get'
101    root[(getInputMsg.typecode.nspname,getInputMsg.typecode.pname)] = 'soap_get'
102
Note: See TracBrowser for help on using the repository browser.