source: TI12-security/trunk/python/Tests/dewsGatekeeper/Gatekeeper_services.py @ 1957

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI12-security/trunk/python/Tests/dewsGatekeeper/Gatekeeper_services.py@1957
Revision 1957, 1.6 KB checked in by pjkersha, 13 years ago (diff)

Example code for Geoserver Gatekeeper web service interface for DEWS.

Line 
1##################################################
2# Gatekeeper_services.py
3# generated by ZSI.generate.wsdl2python
4##################################################
5
6
7from Gatekeeper_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 GatekeeperServiceLocator:
16    Gatekeeper_address = "http://localhost:5000"
17    def getGatekeeperAddress(self):
18        return GatekeeperServiceLocator.Gatekeeper_address
19    def getGatekeeper(self, url=None, **kw):
20        return GatekeeperBindingSOAP(url or GatekeeperServiceLocator.Gatekeeper_address, **kw)
21
22# Methods
23class GatekeeperBindingSOAP:
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 0xb78a728c>
32    def get(self, userX509Cert,userAttributeCertificate,geoserverRequest):
33
34        request = getInputMsg()
35        request._userX509Cert = userX509Cert
36        request._userAttributeCertificate = userAttributeCertificate
37        request._geoserverRequest = geoserverRequest
38
39        kw = {}
40        # no input wsaction
41        self.binding.Send(None, None, request, soapaction="get", **kw)
42        # no output wsaction
43        response = self.binding.Receive(getOutputMsg.typecode)
44        geoServerResponse = response._geoServerResponse
45        return geoServerResponse
46
47getInputMsg = ns0.get_Dec().pyclass
48
49getOutputMsg = ns0.getResponse_Dec().pyclass
Note: See TracBrowser for help on using the repository browser.