source: TI12-security/trunk/ndg_saml/ndg/soap/__init__.py @ 7560

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI12-security/trunk/ndg_saml/ndg/soap/__init__.py@7560
Revision 7560, 1.9 KB checked in by pjkersha, 9 years ago (diff)

Merged ndg.soap back into ndg_saml package - simpler to keep it together.

Line 
1"""SOAP common package for NDG SAML. 
2
3Initially for use with SAML SOAP Bindings.  This itself
4uses ElementTree.  This SOAP interface provides an ElementTree interface to
5support it
6
7NERC DataGrid Project
8"""
9__author__ = "P J Kershaw"
10__date__ = "24/07/09"
11__copyright__ = "(C) 2009 Science and Technology Facilities Council"
12__license__ = "http://www.apache.org/licenses/LICENSE-2.0"
13__contact__ = "Philip.Kershaw@stfc.ac.uk"
14__revision__ = '$Id: __init__.py 7130 2010-06-30 13:33:07Z pjkersha $'
15import logging
16log = logging.getLogger(__name__)
17
18class SOAPException(Exception):
19    """Base SAOP Exception class"""
20   
21class SOAPFault(SOAPException):
22    """SOAP Fault"""
23   
24class SOAPObject(object):
25    """Base class for SOAP envelope, header and body elements"""
26   
27    ELEMENT_PREFIX = "soap11"
28    SOAP11_NS = "http://schemas.xmlsoap.org/soap/envelope/"
29    SOAP12_NS = "http://www.w3.org/2003/05/soap-envelope"
30    DEFAULT_NS = SOAP11_NS
31   
32    def create(self):
33        raise NotImplementedError()
34   
35    def parse(self):
36        raise NotImplementedError()
37   
38    def serialize(self):
39        raise NotImplementedError()
40   
41    def prettyPrint(self):
42        raise NotImplementedError()
43 
44   
45class SOAPEnvelopeBase(SOAPObject):
46    """SOAP Envelope"""
47   
48    DEFAULT_ELEMENT_LOCAL_NAME = "Envelope"
49    DEFAULT_ELEMENT_NS = SOAPObject.DEFAULT_NS
50    DEFAULT_ELEMENT_NS_PREFIX = SOAPObject.ELEMENT_PREFIX
51   
52    soapHeader = property()
53    soapBody = property()
54   
55   
56class SOAPHeaderBase(SOAPObject):
57    """SOAP Header base class"""
58   
59    DEFAULT_ELEMENT_LOCAL_NAME = "Header"
60    DEFAULT_ELEMENT_NS = SOAPObject.DEFAULT_NS
61    DEFAULT_ELEMENT_NS_PREFIX = SOAPObject.ELEMENT_PREFIX   
62       
63class SOAPBodyBase(SOAPObject):
64    """SOAP Body base class"""
65   
66    DEFAULT_ELEMENT_LOCAL_NAME = "Body"
67    DEFAULT_ELEMENT_NS = SOAPObject.DEFAULT_NS
68    DEFAULT_ELEMENT_NS_PREFIX = SOAPObject.ELEMENT_PREFIX
Note: See TracBrowser for help on using the repository browser.