Ignore:
Timestamp:
27/07/09 12:08:00 (11 years ago)
Author:
pjkersha
Message:

Added urllib2 based SOAP client handler class.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI12-security/trunk/python/ndg.security.common/ndg/security/common/soap/__init__.py

    r5520 r5521  
    11"""SOAP common package for NDG Security.  See ndg.security.server.wsgi for 
    2 server side specific code 
     2server side specific code. 
     3 
     4Initially for use with SAML SOAP Binding to Attribute Authority.  This itself 
     5uses ElementTree.  This SOAP interface provides an ElementTree interface to 
     6support it 
    37 
    48NERC DataGrid Project 
    59""" 
    610__author__ = "P J Kershaw" 
    7 __date__ = "27/07/09" 
    8 __copyright__ = "" 
     11__date__ = "24/07/09" 
     12__copyright__ = "(C) 2009 Science and Technology Facilities Council" 
    913__license__ = "BSD - see LICENSE file in top-level directory" 
    1014__contact__ = "Philip.Kershaw@stfc.ac.uk" 
    11 __revision__ = '$Id:$' 
     15__revision__ = '$Id$' 
     16import logging 
     17log = logging.getLogger(__name__) 
     18 
     19class SOAPException(Exception): 
     20    """Base SAOP Exception class""" 
     21     
     22class SOAPFault(SOAPException): 
     23    """SOAP Fault""" 
     24     
     25class SOAPObject(object): 
     26    """Base class for SOAP envelope, header and body elements""" 
     27     
     28    ELEMENT_PREFIX = "SOAP-ENV" 
     29    SOAP11_NS = "http://schemas.xmlsoap.org/soap/envelope/" 
     30    SOAP12_NS = "http://www.w3.org/2003/05/soap-envelope" 
     31    DEFAULT_NS = SOAP11_NS 
     32     
     33    def create(self): 
     34        raise NotImplementedError() 
     35     
     36    def parse(self): 
     37        raise NotImplementedError() 
     38     
     39    def serialize(self): 
     40        raise NotImplementedError() 
     41     
     42    def prettyPrint(self): 
     43        raise NotImplementedError() 
     44   
     45     
     46class SOAPEnvelopeBase(SOAPObject): 
     47    """SOAP Envelope""" 
     48     
     49    DEFAULT_ELEMENT_LOCAL_NAME = "Envelope" 
     50    DEFAULT_ELEMENT_NS = SOAPObject.DEFAULT_NS 
     51    DEFAULT_ELEMENT_NS_PREFIX = SOAPObject.ELEMENT_PREFIX 
     52     
     53    soapHeader = property() 
     54    soapBody = property() 
     55     
     56     
     57class SOAPHeaderBase(SOAPObject): 
     58    """SOAP Header base class""" 
     59     
     60    DEFAULT_ELEMENT_LOCAL_NAME = "Header" 
     61    DEFAULT_ELEMENT_NS = SOAPObject.DEFAULT_NS 
     62    DEFAULT_ELEMENT_NS_PREFIX = SOAPObject.ELEMENT_PREFIX     
     63         
     64class SOAPBodyBase(SOAPObject): 
     65    """SOAP Body base class""" 
     66     
     67    DEFAULT_ELEMENT_LOCAL_NAME = "Body" 
     68    DEFAULT_ELEMENT_NS = SOAPObject.DEFAULT_NS 
     69    DEFAULT_ELEMENT_NS_PREFIX = SOAPObject.ELEMENT_PREFIX 
Note: See TracChangeset for help on using the changeset viewer.