1 from __future__ import nested_scopes
4 GSIServer - Contributed by Ivan R. Judson <judson@mcs.anl.gov>
7 ################################################################################
9 # SOAPpy - Cayce Ullman (cayce@actzero.com)
10 # Brian Matthews (blm@actzero.com)
11 # Gregory Warnes (Gregory.R.Warnes@Pfizer.com)
12 # Christopher Blunck (blunck@gst.com)
14 ################################################################################
15 # Copyright (c) 2003, Pfizer
16 # Copyright (c) 2001, Cayce Ullman.
17 # Copyright (c) 2001, Brian Matthews.
19 # All rights reserved.
21 # Redistribution and use in source and binary forms, with or without
22 # modification, are permitted provided that the following conditions are met:
23 # Redistributions of source code must retain the above copyright notice, this
24 # list of conditions and the following disclaimer.
26 # Redistributions in binary form must reproduce the above copyright notice,
27 # this list of conditions and the following disclaimer in the documentation
28 # and/or other materials provided with the distribution.
30 # Neither the name of actzero, inc. nor the names of its contributors may
31 # be used to endorse or promote products derived from this software without
32 # specific prior written permission.
34 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
35 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
36 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
37 # ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR
38 # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
39 # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
40 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
41 # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
42 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
43 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
45 ################################################################################
48 ident = '$Id: GSIServer.py 1468 2008-05-24 01:55:33Z warnes $'
49 from version import __version__
60 from Parser import parseSOAPRPC
61 from Config import SOAPConfig
62 from Types import faultType, voidType, simplify
64 from SOAPBuilder import buildSOAP
65 from Utilities import debugHeader, debugFooter
67 try: from M2Crypto import SSL
74 from pyGlobus.io import GSITCPSocketServer, ThreadingGSITCPSocketServer
75 from pyGlobus import ioc
79 config.channel_mode = ioc.GLOBUS_IO_SECURE_CHANNEL_MODE_GSI_WRAP
80 config.delegation_mode = ioc.GLOBUS_IO_SECURE_DELEGATION_MODE_FULL_PROXY
82 config.authMethod = "_authorize"
87 class GSISOAPServer(GSITCPSocketServer, SOAPServerBase):
88 def __init__(self, addr = ('localhost', 8000),
89 RequestHandler = SOAPRequestHandler, log = 0,
90 encoding = 'UTF-8', config = Config, namespace = None):
92 # Test the encoding, raising an exception if it's not known
96 self.namespace = namespace
99 self.encoding = encoding
103 self.allow_reuse_address= 1
105 GSITCPSocketServer.__init__(self, addr, RequestHandler,
106 self.config.channel_mode,
107 self.config.delegation_mode,
108 tcpAttr = self.config.tcpAttr)
110 def get_request(self):
111 sock, addr = GSITCPSocketServer.get_request(self)
115 class ThreadingGSISOAPServer(ThreadingGSITCPSocketServer, SOAPServerBase):
117 def __init__(self, addr = ('localhost', 8000),
118 RequestHandler = SOAPRequestHandler, log = 0,
119 encoding = 'UTF-8', config = Config, namespace = None):
121 # Test the encoding, raising an exception if it's not known
125 self.namespace = namespace
128 self.encoding = encoding
132 self.allow_reuse_address= 1
134 ThreadingGSITCPSocketServer.__init__(self, addr, RequestHandler,
135 self.config.channel_mode,
136 self.config.delegation_mode,
137 tcpAttr = self.config.tcpAttr)
139 def get_request(self):
140 sock, addr = ThreadingGSITCPSocketServer.get_request(self)