source: TI12-security/trunk/NDGSecurity/python/Tests/SimpleCA/SimpleCA_client.py @ 7080

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI12-security/trunk/NDGSecurity/python/Tests/SimpleCA/SimpleCA_client.py
Revision 7080, 1.4 KB checked in by pjkersha, 10 years ago (diff)
  • Property svn:keywords set to Id
Line 
1##################################################
2# SimpleCA_client.py
3# generated by ZSI.generate.wsdl2python
4##################################################
5
6
7
8import urlparse, types
9from ZSI.TCcompound import ComplexType, Struct
10from ZSI import client
11import ZSI
12
13from SimpleCA_messages import certRequest, certResponse
14
15# Locator
16class SimpleCAServiceLocator:
17    SimpleCA_address = "http://localhost:5001"
18    def getSimpleCAAddress(self):
19        return SimpleCAServiceLocator.SimpleCA_address
20    def getSimpleCA(self, url=None, **kw):
21        return SimpleCABindingSOAP(url or SimpleCAServiceLocator.SimpleCA_address, **kw)
22
23# Methods
24class SimpleCABindingSOAP:
25    def __init__(self, url, **kw):
26        kw.setdefault("readerclass", None)
27        kw.setdefault("writerclass", None)
28        # no resource properties
29        self.binding = client.Binding(url=url, **kw)
30        # no ws-addressing
31
32    # op: <ZSI.wstools.WSDLTools.Message instance at 0xb6e3416c>
33    def reqCert(self, x509CertReq):
34
35        request = certRequest()
36        request.x509CertReq = x509CertReq
37
38        kw = {}
39        # no input wsaction
40        self.binding.Send(None, None, request, soapaction="reqCert", **kw)
41        # no output wsaction
42        response = self.binding.Receive(certResponse.typecode)
43        x509Cert = response.x509Cert
44        errMsg = response.errMsg
45        return x509Cert,errMsg
Note: See TracBrowser for help on using the repository browser.