[Zope-CVS] CVS: Packages/WebService - SOAPMessage.py:1.2 Transports.py:1.5
Brian Lloyd
brian@digicool.com
Mon, 3 Dec 2001 10:44:55 -0500
Update of /cvs-repository/Packages/WebService
In directory cvs.zope.org:/tmp/cvs-serv26518
Modified Files:
SOAPMessage.py Transports.py
Log Message:
Added bug fix patches - thanks to Sean Bowman.
=== Packages/WebService/SOAPMessage.py 1.1 => 1.2 ===
+
+# SOAPBlock?
+# most doc-style used for rpc
+#
class SOAPMessage:
"""A SOAPMessage provides a higher level interface for working with
SOAP messages that handles most of the details of serialization."""
@@ -37,9 +41,9 @@
"""Return the content type of the serialized message body."""
return getattr(self, 'content_type', 'text/xml')
- def getMessageBody(self):
- """Return the serialized message body of the SOAP message."""
- return self.body
+ def getMimeParts(self):
+ """Return the MIME message parts associated with the SOAP message."""
+ return self.mimeparts
def getMimePart(self, name):
"""Return the named MIME message part associated with the message,
@@ -49,9 +53,13 @@
return item
return None
- def getMimeParts(self):
- """Return the MIME message parts associated with the SOAP message."""
- return self.mimeparts
+ def addMimePart(self, name, content_type, data):
+ """Add a MIME part to the message. Note that adding MIME parts
+ causes the message to be sent as a mime/multipart message."""
+ part = MIMEPart(name, content_type, data)
+ self.mimeparts.append(part)
+ param = Parameter(name, part, None)
+ self.parameters.append(param)
def addSoapHeader(self, name, namespace, value, type, actor=None,
mustUnderstand=0,):
@@ -93,6 +101,10 @@
result.append(item)
return result
+ def getMessageBody(self):
+ """Return the serialized message body of the SOAP message."""
+ return self.body
+
def isFault(self):
"""Return true if the SOAP response message contains a fault."""
return self.getFault() is not None
@@ -102,14 +114,6 @@
as a SOAPFault or None if no fault is present in the message."""
return getattr(self, 'fault', None)
- def addMimeParam(self, name, content_type, data):
- """Add a MIME part to the message. Note that adding MIME parts
- causes the message to be sent as a mime/multipart message."""
- part = MIMEPart(name, content_type, data)
- self.mimeparts.append(part)
- param = Parameter(name, part, None)
- self.parameters.append(param)
-
def addParameter(self, name, value, type, namespace=None):
"""Add a parameter to the SOAP request message. Parameters are
serialized and sent in the order they are added."""
@@ -118,7 +122,7 @@
def getParameter(self, name):
"""Return the named message parameter of the SOAP response."""
- for item in self.params:
+ for item in self.parameters:
if item.name == name:
return item
return None
=== Packages/WebService/Transports.py 1.4 => 1.5 ===
if scheme == 'https':
- if not hasattr(socket, 'ssl'):
- raise ValueError(
- 'This Python installation does not have SSL support.'
- )
- conn = TimeoutHTTPS(host, None, self.timeout)
- else:
- conn = TimeoutHTTP(host, None, self.timeout,
+ conn = TimeoutHTTPS(host, None, self.timeout,
key_file = self.key_file,
cert_file = self.cert_file
)
+ else:
+ conn = TimeoutHTTP(host, None, self.timeout)
conn.putrequest(verb, path)
@@ -208,6 +204,10 @@
bypassed for send and recv calls. Since our hack _is_ in place at
connect() time, it should at least provide some timeout protection."""
def __init__(self, host, port=None, timeout=20, **kwargs):
+ if not hasattr(socket, 'ssl'):
+ raise ValueError(
+ 'This Python installation does not have SSL support.'
+ )
HTTPSConnection.__init__(self, str(host), port, **kwargs)
self.timeout = timeout