You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
(47) |
Apr
(48) |
May
(68) |
Jun
(9) |
Jul
(43) |
Aug
(10) |
Sep
(81) |
Oct
(43) |
Nov
(22) |
Dec
(60) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(44) |
Feb
(48) |
Mar
(53) |
Apr
(40) |
May
(107) |
Jun
(28) |
Jul
(8) |
Aug
(8) |
Sep
(28) |
Oct
(32) |
Nov
(43) |
Dec
(13) |
| 2005 |
Jan
(45) |
Feb
(110) |
Mar
(36) |
Apr
(14) |
May
(28) |
Jun
(3) |
Jul
(10) |
Aug
(8) |
Sep
(27) |
Oct
(13) |
Nov
(3) |
Dec
(20) |
| 2006 |
Jan
(32) |
Feb
(29) |
Mar
(17) |
Apr
(21) |
May
(38) |
Jun
(14) |
Jul
(6) |
Aug
(2) |
Sep
(4) |
Oct
(36) |
Nov
(11) |
Dec
(10) |
| 2007 |
Jan
(41) |
Feb
(10) |
Mar
(7) |
Apr
(7) |
May
(10) |
Jun
(15) |
Jul
(11) |
Aug
(1) |
Sep
(3) |
Oct
(13) |
Nov
(16) |
Dec
(1) |
| 2008 |
Jan
(9) |
Feb
(1) |
Mar
|
Apr
|
May
(22) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(1) |
Dec
(7) |
| 2009 |
Jan
(3) |
Feb
(1) |
Mar
(3) |
Apr
(6) |
May
(3) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2010 |
Jan
|
Feb
|
Mar
(3) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
(1) |
| 2012 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2014 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: M.-A. L. <ma...@le...> - 2003-03-31 07:51:09
|
bl...@us... wrote:
> Update of /cvsroot/pywebsvcs/zsi/ZSI
> In directory sc8-pr-cvs1:/tmp/cvs-serv30132
>
> Modified Files:
> client.py
> Log Message:
> fixed programmer error. to implement a catch-all, do not pass Exception as a symbol
Catching Exception should be the same as the generic except nowadays,
since all exception classes are subclasses of this class. The only
things you don't catch are string based exceptions.
Note that a generic try:except: is almost always a bad idea,
since it also catches exceptions you don't to mask such as
KeyboardInterrupt, signal handler related exceptions, SystemExit,
etc.
> Index: client.py
> ===================================================================
> RCS file: /cvsroot/pywebsvcs/zsi/ZSI/client.py,v
> retrieving revision 1.15
> retrieving revision 1.16
> diff -u -d -r1.15 -r1.16
> --- client.py 18 Mar 2003 05:06:57 -0000 1.15
> +++ client.py 31 Mar 2003 03:45:54 -0000 1.16
> @@ -8,6 +8,8 @@
> from ZSI.auth import AUTH
> import base64, httplib, cStringIO as StringIO, types, time
>
> +import string
> +
> _b64_encode = base64.encodestring
>
> _AuthHeader = '<BasicAuth xmlns="' + ZSI_SCHEMA_URI + '''">
> @@ -260,7 +262,7 @@
> import ComplexTypes
> instance = eval('ComplexTypes.%s' % type)
> return instance.typecode.parse(data[0], self.ps)
> - except Exception:
> + except:
> return tc.parse(data[0], self.ps)
> elif hasattr(replytype, 'typecode'):
> tc = replytype.typecode
>
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by:
> The Definitive IT and Networking Event. Be There!
> NetWorld+Interop Las Vegas 2003 -- Register today!
> http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en
> _______________________________________________
> Pywebsvcs-checkins mailing list
> Pyw...@li...
> https://lists.sourceforge.net/lists/listinfo/pywebsvcs-checkins
--
Marc-Andre Lemburg
eGenix.com
Professional Python Software directly from the Source (#1, Mar 31 2003)
>>> Python/Zope Products & Consulting ... http://www.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/
________________________________________________________________________
Python UK 2003, Oxford: 1 days left
EuroPython 2003, Charleroi, Belgium: 85 days left
|
|
From: <bl...@us...> - 2003-03-31 03:46:02
|
Update of /cvsroot/pywebsvcs/zsi/ZSI
In directory sc8-pr-cvs1:/tmp/cvs-serv30132
Modified Files:
client.py
Log Message:
fixed programmer error. to implement a catch-all, do not pass Exception as a symbol
Index: client.py
===================================================================
RCS file: /cvsroot/pywebsvcs/zsi/ZSI/client.py,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- client.py 18 Mar 2003 05:06:57 -0000 1.15
+++ client.py 31 Mar 2003 03:45:54 -0000 1.16
@@ -8,6 +8,8 @@
from ZSI.auth import AUTH
import base64, httplib, cStringIO as StringIO, types, time
+import string
+
_b64_encode = base64.encodestring
_AuthHeader = '<BasicAuth xmlns="' + ZSI_SCHEMA_URI + '''">
@@ -260,7 +262,7 @@
import ComplexTypes
instance = eval('ComplexTypes.%s' % type)
return instance.typecode.parse(data[0], self.ps)
- except Exception:
+ except:
return tc.parse(data[0], self.ps)
elif hasattr(replytype, 'typecode'):
tc = replytype.typecode
|
|
From: <bov...@us...> - 2003-03-28 17:56:15
|
Update of /cvsroot/pywebsvcs/zsi/ZSI/wsdl
In directory sc8-pr-cvs1:/tmp/cvs-serv16809
Modified Files:
WSDLTools.py
Log Message:
Modified Files:
WSDLTools.py
----------------------------------------------------------------------
In load method of WSDL class location was not being reset for each imported
element. Importing multiple documents directly from a single document
was broken.
<definition ..
<import
<import
----------------------------------------------------------------------
Index: WSDLTools.py
===================================================================
RCS file: /cvsroot/pywebsvcs/zsi/ZSI/wsdl/WSDLTools.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- WSDLTools.py 25 Mar 2003 19:02:00 -0000 1.3
+++ WSDLTools.py 28 Mar 2003 17:56:09 -0000 1.4
@@ -147,6 +147,7 @@
break
for element in imports:
self._import(document, element)
+ location = DOM.getAttr(element, 'location')
imported[location] = 1
for element in DOM.getElements(definitions, None, None):
|
|
From: <wa...@us...> - 2003-03-27 16:36:33
|
Update of /cvsroot/pywebsvcs/SOAPpy/SOAPpy In directory sc8-pr-cvs1:/tmp/cvs-serv8081/SOAPpy Modified Files: SOAP.py Log Message: Updated version to 0.9.9-pre3 and added reason to changelog. Index: SOAP.py =================================================================== RCS file: /cvsroot/pywebsvcs/SOAPpy/SOAPpy/SOAP.py,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- SOAP.py 27 Mar 2003 16:22:53 -0000 1.26 +++ SOAP.py 27 Mar 2003 16:36:29 -0000 1.27 @@ -104,7 +104,7 @@ ident = '$Id$' -__version__ = "0.9.9-pre2" +__version__ = "0.9.9-pre3" ################################################################################ |
|
From: <wa...@us...> - 2003-03-27 16:36:33
|
Update of /cvsroot/pywebsvcs/SOAPpy In directory sc8-pr-cvs1:/tmp/cvs-serv8081 Modified Files: CHANGELOG Log Message: Updated version to 0.9.9-pre3 and added reason to changelog. Index: CHANGELOG =================================================================== RCS file: /cvsroot/pywebsvcs/SOAPpy/CHANGELOG,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- CHANGELOG 27 Mar 2003 13:10:31 -0000 1.10 +++ CHANGELOG 27 Mar 2003 16:36:24 -0000 1.11 @@ -1,7 +1,12 @@ SOAP.py -CHANGES SINCE VERSION 0.9.8-pre1 +CHANGES SINCE VERSION 0.9.9-pre2 + +- Fixed trivial compilation bug on Win32: Only define + SOAPUnixSocketServer if the Unix domain sockets are supported + +CHANGES SINCE VERSION 0.9.9-pre1 - Added request for nested scopes, should now work properly in python 2.1 with named argument calls. |
|
From: <wa...@us...> - 2003-03-27 16:23:07
|
Update of /cvsroot/pywebsvcs/SOAPpy/SOAPpy
In directory sc8-pr-cvs1:/tmp/cvs-serv32714
Modified Files:
SOAP.py
Log Message:
- Only define SOAPUnixSocketServer if the Unix domain sockets are supported
Index: SOAP.py
===================================================================
RCS file: /cvsroot/pywebsvcs/SOAPpy/SOAPpy/SOAP.py,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- SOAP.py 27 Mar 2003 13:07:58 -0000 1.25
+++ SOAP.py 27 Mar 2003 16:22:53 -0000 1.26
@@ -4091,28 +4091,32 @@
SocketServer.TCPServer.__init__(self, addr, RequestHandler)
-class SOAPUnixSocketServer(SocketServer.UnixStreamServer, SOAPServerBase):
-
- def __init__(self, addr = 8000,
- RequestHandler = SOAPRequestHandler, log = 1, encoding = 'UTF-8',
- config = Config, namespace = None, ssl_context = None):
-
- # Test the encoding, raising an exception if it's not known
- if encoding != None:
- ''.encode(encoding)
-
- if ssl_context != None and not config.SSLserver:
- raise AttributeError, \
- "SSL server not supported by this Python installation"
-
- self.namespace = namespace
- self.objmap = {}
- self.funcmap = {}
- self.ssl_context = ssl_context
- self.encoding = encoding
- self.config = config
- self.log = log
-
- self.allow_reuse_address= 1
+# only define class if Unix domain sockets are available
+if hasattr(socket, "AF_UNIX"):
- SocketServer.UnixStreamServer.__init__(self, str(addr), RequestHandler)
+ class SOAPUnixSocketServer(SocketServer.UnixStreamServer, SOAPServerBase):
+
+ def __init__(self, addr = 8000,
+ RequestHandler = SOAPRequestHandler, log = 1, encoding = 'UTF-8',
+ config = Config, namespace = None, ssl_context = None):
+
+ # Test the encoding, raising an exception if it's not known
+ if encoding != None:
+ ''.encode(encoding)
+
+ if ssl_context != None and not config.SSLserver:
+ raise AttributeError, \
+ "SSL server not supported by this Python installation"
+
+ self.namespace = namespace
+ self.objmap = {}
+ self.funcmap = {}
+ self.ssl_context = ssl_context
+ self.encoding = encoding
+ self.config = config
+ self.log = log
+
+ self.allow_reuse_address= 1
+
+ SocketServer.UnixStreamServer.__init__(self, str(addr), RequestHandler)
+
|
|
From: <wa...@us...> - 2003-03-27 13:10:38
|
Update of /cvsroot/pywebsvcs/SOAPpy In directory sc8-pr-cvs1:/tmp/cvs-serv26695 Modified Files: CHANGELOG Log Message: - Added named scope change. Index: CHANGELOG =================================================================== RCS file: /cvsroot/pywebsvcs/SOAPpy/CHANGELOG,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- CHANGELOG 27 Mar 2003 12:32:17 -0000 1.9 +++ CHANGELOG 27 Mar 2003 13:10:31 -0000 1.10 @@ -3,6 +3,9 @@ CHANGES SINCE VERSION 0.9.8-pre1 +- Added request for nested scopes, should now work properly in python + 2.1 with named argument calls. + - Fixed bug caused by omission of the ieee754 module from __init__.py. - SOAPpy now provides a SOAPUnixSocketServer class, which uses a unix |
|
From: <wa...@us...> - 2003-03-27 13:08:01
|
Update of /cvsroot/pywebsvcs/SOAPpy/SOAPpy
In directory sc8-pr-cvs1:/tmp/cvs-serv24568
Modified Files:
SOAP.py
Log Message:
- New argument handling codes needs nested scopes.
Index: SOAP.py
===================================================================
RCS file: /cvsroot/pywebsvcs/SOAPpy/SOAPpy/SOAP.py,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- SOAP.py 26 Mar 2003 21:12:08 -0000 1.24
+++ SOAP.py 27 Mar 2003 13:07:58 -0000 1.25
@@ -79,6 +79,8 @@
################################################################################
"""
+from __future__ import nested_scopes
+
import xml.sax
import UserList
import base64
@@ -3798,6 +3800,7 @@
return self.__last_date_time_string
def do_POST(self):
+ status = 500
try:
if self.server.config.dumpHeadersIn:
s = 'Incoming HTTP headers'
|
|
From: <wa...@us...> - 2003-03-27 12:32:26
|
Update of /cvsroot/pywebsvcs/SOAPpy
In directory sc8-pr-cvs1:/tmp/cvs-serv6113
Modified Files:
CHANGELOG README
Added Files:
RELEASE_INFO
Log Message:
- Updated text files for 0.9.9-pre2 release.
--- NEW FILE: RELEASE_INFO ---
This release fixes the version string problem Mark Bucciarelli pointed
out, as well as a couple of other bugs.
There are 2 important changes:
1) The new name handling mechanism has been enabled by default.
The primary purpose of this release is to allow users to test this
to see if it causes problems. Please take the time to do so. If
there are no problems reported by April 15, 2003, 0.9.9 will be
released with this feature enabled by default.
Note that running a client under an old release of SOAPpy and a
server under this release will be likely to generate errors due to
the different name handling mechanisms.
2) MS-Windows systems should now be fully supported.
This required implmenting a new module, ieee754, which provides
functions for detecting and generating IEEE 754 special floating
point values (+Inf, -Inf, NaN) which are not properly handled by
the Windows implementation of the float() function.
See the changelog for a detailed list of changes from previous releases.
Index: CHANGELOG
===================================================================
RCS file: /cvsroot/pywebsvcs/SOAPpy/CHANGELOG,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- CHANGELOG 26 Mar 2003 05:02:32 -0000 1.8
+++ CHANGELOG 27 Mar 2003 12:32:17 -0000 1.9
@@ -1,16 +1,31 @@
SOAP.py
+CHANGES SINCE VERSION 0.9.8-pre1
+
+- Fixed bug caused by omission of the ieee754 module from __init__.py.
+
+- SOAPpy now provides a SOAPUnixSocketServer class, which uses a unix
+ domain socket instead of a network TCP/IP socket for communication. A
+ corresponding client will be provided in the future. [This class
+ has not yet been tested.]
+
CHANGES SINCE VERSION 0.9.8
-- SOAPpy should now work properly on Microsoft Windows systems.
+- IEEE 754 floating point specials (Inf, -Inf, NaN) should now be
+ properly and consistently handled on all platforms.
- Previously, supporting platforms for which float('Inf') and similar
- produced an error message ( notably Microsoft Windows) required an
- ugly hack in the code which fails entirely under recent versions of
- Python. A new module, ieee754 has been implemented which provides
- functions to handle NaN, Inf, and -Inf, so SOAPPy should now work on
- all platforms that use IEEE 754 double-precision floating point.
+ Added code to explicitly check for and handle IEEE 754 floating
+ point specials (Inf, -Inf, NaN). This replaces an ugly hack for
+ systems whose python float() doesn't understand the strings "Inf",
+ "NaN", etc. Floating point specials should now be properly handled
+ on all operating systems.
+
+ ***SOAPpy should now work properly on all versions of Microsoft Windows.***
+
+ A new module, ieee754 contains the functions required to detect and
+ create NaN, Inf, and -Inf values. This module should be usable in
+ other contexts.
- *** The new argument handling method (via SOAPpy.SOAP.Config.specialArgs=1)
is now enabled by default.***
Index: README
===================================================================
RCS file: /cvsroot/pywebsvcs/SOAPpy/README,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- README 8 Mar 2003 05:10:00 -0000 1.3
+++ README 27 Mar 2003 12:32:18 -0000 1.4
@@ -1,13 +1,12 @@
-Copyright (c) 2001
+Copyright (c) 2001-2003
-SOAP.py 0.9.8
+SOAP.py 0.9.9-pre2
Current Maintainers:
Gregory R. Warnes <gr...@wa...>
Christopher Blunck <bl...@gs...>
-
Original Authors:
Cayce Ullman <c_u...@ya...>
@@ -16,7 +15,6 @@
Contributions by:
Brad Knotwell <b.k...@f5...>
-
MANIFEST:
|
|
From: <wa...@us...> - 2003-03-26 21:12:16
|
Update of /cvsroot/pywebsvcs/SOAPpy/SOAPpy In directory sc8-pr-cvs1:/tmp/cvs-serv22682/SOAPpy Modified Files: SOAP.py Log Message: - Update version number to 0.9.9-pre2 Index: SOAP.py =================================================================== RCS file: /cvsroot/pywebsvcs/SOAPpy/SOAPpy/SOAP.py,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- SOAP.py 26 Mar 2003 16:29:42 -0000 1.23 +++ SOAP.py 26 Mar 2003 21:12:08 -0000 1.24 @@ -102,7 +102,7 @@ ident = '$Id$' -__version__ = "0.9.9-pre1" +__version__ = "0.9.9-pre2" ################################################################################ |
|
From: <wa...@us...> - 2003-03-26 17:55:23
|
Update of /cvsroot/pywebsvcs/SOAPpy/SOAPpy In directory sc8-pr-cvs1:/tmp/cvs-serv21387 Modified Files: __init__.py Log Message: - Added import of ieee754. Index: __init__.py =================================================================== RCS file: /cvsroot/pywebsvcs/SOAPpy/SOAPpy/__init__.py,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- __init__.py 8 Mar 2003 05:10:00 -0000 1.2 +++ __init__.py 26 Mar 2003 17:55:20 -0000 1.3 @@ -1,2 +1,3 @@ import SOAP import XMLname +import ieee754 |
|
From: <wa...@us...> - 2003-03-26 17:54:59
|
Update of /cvsroot/pywebsvcs/SOAPpy/SOAPpy In directory sc8-pr-cvs1:/tmp/cvs-serv21127 Modified Files: ieee754.py Log Message: - Fixed type in __doc__ text. Index: ieee754.py =================================================================== RCS file: /cvsroot/pywebsvcs/SOAPpy/SOAPpy/ieee754.py,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ieee754.py 26 Mar 2003 04:51:00 -0000 1.1 +++ ieee754.py 26 Mar 2003 17:54:55 -0000 1.2 @@ -1,4 +1,4 @@ -"""Utilities for handling IEEE 754 special values +"""Utilities for handling IEEE 754 floating point special values This class implements constants and functions for working with IEEE754 double-precision special values. It provides constants for NaN (Not a @@ -7,7 +7,7 @@ values. The code is implemented in pure python by taking advantage of the -'struck' standard module. Some efficiency could be gained by +'struct' standard module. Some efficiency could be gained by translating the core routines into C. See <http://babbage.cs.qc.edu/courses/cs341/IEEE-754references.html> |
|
From: <wa...@us...> - 2003-03-26 16:29:48
|
Update of /cvsroot/pywebsvcs/SOAPpy/SOAPpy In directory sc8-pr-cvs1:/tmp/cvs-serv8838 Modified Files: SOAP.py Log Message: - Split class SOAPServer into SOAPServerBase and two sublcasses, SOAPServer and SOAPUnixSocketServer. SOAPServer has the same functionality as before, while SOAPUnixSocketServer connects over a Unix domain socket instead of to a (public) TCP/IP port. Index: SOAP.py =================================================================== RCS file: /cvsroot/pywebsvcs/SOAPpy/SOAPpy/SOAP.py,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- SOAP.py 26 Mar 2003 04:51:00 -0000 1.22 +++ SOAP.py 26 Mar 2003 16:29:42 -0000 1.23 @@ -95,6 +95,7 @@ from XMLname import toXMLname, fromXMLname from types import * import ieee754 +import BaseHTTPServer try: from M2Crypto import SSL except: pass @@ -3746,284 +3747,322 @@ ################################################################################ # SOAP Server ################################################################################ -class SOAPServer(SocketServer.TCPServer): - import BaseHTTPServer +class SOAPServerBase: - class SOAPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler): - def version_string(self): - return '<a href="http://pywebsvcs.sf.net">' + \ - 'SOAP.py ' + __version__ + '</a> (Python ' + \ - sys.version.split()[0] + ')' + def get_request(self): + sock, addr = get_request(self) - def date_time_string(self): - self.__last_date_time_string = \ - SOAPServer.BaseHTTPServer.BaseHTTPRequestHandler.\ - date_time_string(self) + if self.ssl_context: + sock = SSL.Connection(self.ssl_context, sock) + sock._setup_ssl(addr) + if sock.accept_ssl() != 1: + raise socket.error, "Couldn't accept SSL connection" - return self.__last_date_time_string + return sock, addr - def do_POST(self): - try: - if self.server.config.dumpHeadersIn: - s = 'Incoming HTTP headers' - debugHeader(s) - print self.raw_requestline.strip() - print "\n".join(map (lambda x: x.strip(), - self.headers.headers)) - debugFooter(s) + def registerObject(self, object, namespace = ''): + if namespace == '': namespace = self.namespace + self.objmap[namespace] = object - data = self.rfile.read(int(self.headers["content-length"])) + def registerFunction(self, function, namespace = '', funcName = None): + if not funcName : funcName = function.__name__ + if namespace == '': namespace = self.namespace + if self.funcmap.has_key(namespace): + self.funcmap[namespace][funcName] = function + else: + self.funcmap[namespace] = {funcName : function} - if self.server.config.dumpSOAPIn: - s = 'Incoming SOAP' - debugHeader(s) - print data, - if data[-1] != '\n': - print - debugFooter(s) + def registerKWObject(self, object, namespace = ''): + if namespace == '': namespace = self.namespace + for i in dir(object.__class__): + if i[0] != "_" and callable(getattr(object, i)): + self.registerKWFunction(getattr(object,i), namespace) - (r, header, body, attrs) = \ - parseSOAPRPC(data, header = 1, body = 1, attrs = 1) + # convenience - wraps your func for you. + def registerKWFunction(self, function, namespace = '', funcName = None): + self.registerFunction(MethodSig(function,keywords=1), namespace, + funcName) - method = r._name - args = r._aslist - kw = r._asdict - - # Handle mixed named and unnamed arguments by assuming - # that all arguments with names of the form "_[0-9]+" - # are unnamed and should be passed in numeric order, - # other arguments are named and should be passed using - # this name. This is a custom exension to the SOAP - # protocol, and is thus disabled by default. To - # enable, set Config.specialArgs to a true value. - if Config.specialArgs: - - ordered_args = {} - named_args = {} - - for (k,v) in kw.items(): - m = re.match("_([0-9]+)", k) - if m is None: - named_args[str(k)] = v - else: - ordered_args[int(m.group(1))] = v - - keylist = ordered_args.keys() - keylist.sort() - tmp = map( lambda x: ordered_args[x], keylist) +class SOAPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler): + def version_string(self): + return '<a href="http://pywebsvcs.sf.net">' + \ + 'SOAP.py ' + __version__ + '</a> (Python ' + \ + sys.version.split()[0] + ')' - ordered_args = tmp + def date_time_string(self): + self.__last_date_time_string = \ + BaseHTTPServer.BaseHTTPRequestHandler.\ + date_time_string(self) - #print '<-> Argument Matching Yielded:' - #print '<-> Ordered Arguments:' + str(ordered_args) - #print '<-> Named Arguments :' + str(named_args) - + return self.__last_date_time_string - ns = r._ns - resp = "" - # For fault messages - if ns: - nsmethod = "%s:%s" % (ns, method) - else: - nsmethod = method + def do_POST(self): + try: + if self.server.config.dumpHeadersIn: + s = 'Incoming HTTP headers' + debugHeader(s) + print self.raw_requestline.strip() + print "\n".join(map (lambda x: x.strip(), + self.headers.headers)) + debugFooter(s) - try: - # First look for registered functions - if self.server.funcmap.has_key(ns) and \ - self.server.funcmap[ns].has_key(method): - f = self.server.funcmap[ns][method] - else: # Now look at registered objects - # Check for nested attributes. This works even if - # there are none, because the split will return - # [method] - f = self.server.objmap[ns] - l = method.split(".") - for i in l: - f = getattr(f, i) - except: - resp = buildSOAP(faultType("%s:Client" % NS.ENV_T, - "No method %s found" % nsmethod, - "%s %s" % tuple(sys.exc_info()[0:2])), - encoding = self.server.encoding, - config = self.server.config) - status = 500 - else: - try: - if header: - x = HeaderHandler(header, attrs) + data = self.rfile.read(int(self.headers["content-length"])) - # If it's wrapped, some special action may be needed - - if isinstance(f, MethodSig): - c = None - - if f.context: # Build context object - c = SOAPContext(header, body, attrs, data, - self.connection, self.headers, - self.headers["soapaction"]) + if self.server.config.dumpSOAPIn: + s = 'Incoming SOAP' + debugHeader(s) + print data, + if data[-1] != '\n': + print + debugFooter(s) - if Config.specialArgs: - if c: - named_args["_SOAPContext"] = c - fr = apply(f, ordered_args, named_args) - elif f.keywords: - # This is lame, but have to de-unicode - # keywords - - strkw = {} - - for (k, v) in kw.items(): - strkw[str(k)] = v - if c: - strkw["_SOAPContext"] = c - fr = apply(f, (), strkw) - elif c: - fr = apply(f, args, {'_SOAPContext':c}) - else: - fr = apply(f, args, {}) + (r, header, body, attrs) = \ + parseSOAPRPC(data, header = 1, body = 1, attrs = 1) - else: - if Config.specialArgs: - fr = apply(f, ordered_args, named_args) - else: - fr = apply(f, args, {}) + method = r._name + args = r._aslist + kw = r._asdict + + # Handle mixed named and unnamed arguments by assuming + # that all arguments with names of the form "_[0-9]+" + # are unnamed and should be passed in numeric order, + # other arguments are named and should be passed using + # this name. This is a custom exension to the SOAP + # protocol, and is thus disabled by default. To + # enable, set Config.specialArgs to a true value. + if Config.specialArgs: + + ordered_args = {} + named_args = {} + + for (k,v) in kw.items(): + m = re.match("_([0-9]+)", k) + if m is None: + named_args[str(k)] = v + else: + ordered_args[int(m.group(1))] = v - if type(fr) == type(self) and \ - isinstance(fr, voidType): - resp = buildSOAP(kw = {'%sResponse' % method: fr}, - encoding = self.server.encoding, - config = self.server.config) - else: - resp = buildSOAP(kw = - {'%sResponse' % method: {'Result': fr}}, - encoding = self.server.encoding, - config = self.server.config) - except Exception, e: - import traceback - info = sys.exc_info() + keylist = ordered_args.keys() + keylist.sort() + tmp = map( lambda x: ordered_args[x], keylist) - if self.server.config.dumpFaultInfo: - s = 'Method %s exception' % nsmethod - debugHeader(s) - traceback.print_exception(info[0], info[1], - info[2]) - debugFooter(s) + ordered_args = tmp - if isinstance(e, faultType): - f = e - else: - f = faultType("%s:Server" % NS.ENV_T, - "Method %s failed." % nsmethod) + #print '<-> Argument Matching Yielded:' + #print '<-> Ordered Arguments:' + str(ordered_args) + #print '<-> Named Arguments :' + str(named_args) + - if self.server.config.returnFaultInfo: - f._setDetail("".join(traceback.format_exception( - info[0], info[1], info[2]))) - elif not hasattr(f, 'detail'): - f._setDetail("%s %s" % (info[0], info[1])) + ns = r._ns + resp = "" + # For fault messages + if ns: + nsmethod = "%s:%s" % (ns, method) + else: + nsmethod = method - resp = buildSOAP(f, encoding = self.server.encoding, - config = self.server.config) - status = 500 - else: - status = 200 - except faultType, e: - import traceback - info = sys.exc_info() + try: + # First look for registered functions + if self.server.funcmap.has_key(ns) and \ + self.server.funcmap[ns].has_key(method): + f = self.server.funcmap[ns][method] + else: # Now look at registered objects + # Check for nested attributes. This works even if + # there are none, because the split will return + # [method] + f = self.server.objmap[ns] + l = method.split(".") + for i in l: + f = getattr(f, i) + except: + resp = buildSOAP(faultType("%s:Client" % NS.ENV_T, + "No method %s found" % nsmethod, + "%s %s" % tuple(sys.exc_info()[0:2])), + encoding = self.server.encoding, + config = self.server.config) + status = 500 + else: + try: + if header: + x = HeaderHandler(header, attrs) - if self.server.config.dumpFaultInfo: - s = 'Received fault exception' - debugHeader(s) - traceback.print_exception(info[0], info[1], - info[2]) - debugFooter(s) + # If it's wrapped, some special action may be needed + + if isinstance(f, MethodSig): + c = None + + if f.context: # Build context object + c = SOAPContext(header, body, attrs, data, + self.connection, self.headers, + self.headers["soapaction"]) - if self.server.config.returnFaultInfo: - e._setDetail("".join(traceback.format_exception( - info[0], info[1], info[2]))) - elif not hasattr(e, 'detail'): - e._setDetail("%s %s" % (info[0], info[1])) + if Config.specialArgs: + if c: + named_args["_SOAPContext"] = c + fr = apply(f, ordered_args, named_args) + elif f.keywords: + # This is lame, but have to de-unicode + # keywords + + strkw = {} + + for (k, v) in kw.items(): + strkw[str(k)] = v + if c: + strkw["_SOAPContext"] = c + fr = apply(f, (), strkw) + elif c: + fr = apply(f, args, {'_SOAPContext':c}) + else: + fr = apply(f, args, {}) - resp = buildSOAP(e, encoding = self.server.encoding, - config = self.server.config) - status = 500 - except: - # internal error, report as HTTP server error - if self.server.config.dumpFaultInfo: - import traceback - s = 'Internal exception' - debugHeader(s) - traceback.print_exc () - debugFooter(s) - self.send_response(500) - self.end_headers() + else: + if Config.specialArgs: + fr = apply(f, ordered_args, named_args) + else: + fr = apply(f, args, {}) - if self.server.config.dumpHeadersOut and \ - self.request_version != 'HTTP/0.9': - s = 'Outgoing HTTP headers' - debugHeader(s) - if self.responses.has_key(status): - s = ' ' + self.responses[status][0] + + if type(fr) == type(self) and \ + isinstance(fr, voidType): + resp = buildSOAP(kw = {'%sResponse' % method: fr}, + encoding = self.server.encoding, + config = self.server.config) else: - s = '' - print "%s %d%s" % (self.protocol_version, 500, s) - print "Server:", self.version_string() - print "Date:", self.__last_date_time_string - debugFooter(s) - else: - # got a valid SOAP response - self.send_response(status) + resp = buildSOAP(kw = + {'%sResponse' % method: {'Result': fr}}, + encoding = self.server.encoding, + config = self.server.config) + except Exception, e: + import traceback + info = sys.exc_info() - t = 'text/xml'; - if self.server.encoding != None: - t += '; charset="%s"' % self.server.encoding - self.send_header("Content-type", t) - self.send_header("Content-length", str(len(resp))) - self.end_headers() + if self.server.config.dumpFaultInfo: + s = 'Method %s exception' % nsmethod + debugHeader(s) + traceback.print_exception(info[0], info[1], + info[2]) + debugFooter(s) - if self.server.config.dumpHeadersOut and \ - self.request_version != 'HTTP/0.9': - s = 'Outgoing HTTP headers' - debugHeader(s) - if self.responses.has_key(status): - s = ' ' + self.responses[status][0] + if isinstance(e, faultType): + f = e else: - s = '' - print "%s %d%s" % (self.protocol_version, status, s) - print "Server:", self.version_string() - print "Date:", self.__last_date_time_string - print "Content-type:", t - print "Content-length:", len(resp) - debugFooter(s) + f = faultType("%s:Server" % NS.ENV_T, + "Method %s failed." % nsmethod) - if self.server.config.dumpSOAPOut: - s = 'Outgoing SOAP' - debugHeader(s) - print resp, - if resp[-1] != '\n': - print - debugFooter(s) + if self.server.config.returnFaultInfo: + f._setDetail("".join(traceback.format_exception( + info[0], info[1], info[2]))) + elif not hasattr(f, 'detail'): + f._setDetail("%s %s" % (info[0], info[1])) - self.wfile.write(resp) - self.wfile.flush() + resp = buildSOAP(f, encoding = self.server.encoding, + config = self.server.config) + status = 500 + else: + status = 200 + except faultType, e: + import traceback + info = sys.exc_info() - # We should be able to shut down both a regular and an SSL - # connection, but under Python 2.1, calling shutdown on an - # SSL connections drops the output, so this work-around. - # This should be investigated more someday. + if self.server.config.dumpFaultInfo: + s = 'Received fault exception' + debugHeader(s) + traceback.print_exception(info[0], info[1], + info[2]) + debugFooter(s) - if self.server.config.SSLserver and \ - isinstance(self.connection, SSL.Connection): - self.connection.set_shutdown(SSL.SSL_SENT_SHUTDOWN | - SSL.SSL_RECEIVED_SHUTDOWN) + if self.server.config.returnFaultInfo: + e._setDetail("".join(traceback.format_exception( + info[0], info[1], info[2]))) + elif not hasattr(e, 'detail'): + e._setDetail("%s %s" % (info[0], info[1])) + + resp = buildSOAP(e, encoding = self.server.encoding, + config = self.server.config) + status = 500 + except: + # internal error, report as HTTP server error + if self.server.config.dumpFaultInfo: + import traceback + s = 'Internal exception' + debugHeader(s) + traceback.print_exc () + debugFooter(s) + self.send_response(500) + self.end_headers() + + if self.server.config.dumpHeadersOut and \ + self.request_version != 'HTTP/0.9': + s = 'Outgoing HTTP headers' + debugHeader(s) + if self.responses.has_key(status): + s = ' ' + self.responses[status][0] else: - self.connection.shutdown(1) + s = '' + print "%s %d%s" % (self.protocol_version, 500, s) + print "Server:", self.version_string() + print "Date:", self.__last_date_time_string + debugFooter(s) + else: + # got a valid SOAP response + self.send_response(status) + + t = 'text/xml'; + if self.server.encoding != None: + t += '; charset="%s"' % self.server.encoding + self.send_header("Content-type", t) + self.send_header("Content-length", str(len(resp))) + self.end_headers() + + if self.server.config.dumpHeadersOut and \ + self.request_version != 'HTTP/0.9': + s = 'Outgoing HTTP headers' + debugHeader(s) + if self.responses.has_key(status): + s = ' ' + self.responses[status][0] + else: + s = '' + print "%s %d%s" % (self.protocol_version, status, s) + print "Server:", self.version_string() + print "Date:", self.__last_date_time_string + print "Content-type:", t + print "Content-length:", len(resp) + debugFooter(s) + + if self.server.config.dumpSOAPOut: + s = 'Outgoing SOAP' + debugHeader(s) + print resp, + if resp[-1] != '\n': + print + debugFooter(s) + + self.wfile.write(resp) + self.wfile.flush() + + # We should be able to shut down both a regular and an SSL + # connection, but under Python 2.1, calling shutdown on an + # SSL connections drops the output, so this work-around. + # This should be investigated more someday. + + if self.server.config.SSLserver and \ + isinstance(self.connection, SSL.Connection): + self.connection.set_shutdown(SSL.SSL_SENT_SHUTDOWN | + SSL.SSL_RECEIVED_SHUTDOWN) + else: + self.connection.shutdown(1) + + def log_message(self, format, *args): + if self.server.log: + BaseHTTPServer.BaseHTTPRequestHandler.\ + log_message (self, format, *args) + - def log_message(self, format, *args): - if self.server.log: - SOAPServer.BaseHTTPServer.BaseHTTPRequestHandler.\ - log_message (self, format, *args) + +class SOAPServer(SocketServer.TCPServer, SOAPServerBase): def __init__(self, addr = ('localhost', 8000), RequestHandler = SOAPRequestHandler, log = 1, encoding = 'UTF-8', @@ -4049,36 +4088,28 @@ SocketServer.TCPServer.__init__(self, addr, RequestHandler) - def get_request(self): - sock, addr = SocketServer.TCPServer.get_request(self) +class SOAPUnixSocketServer(SocketServer.UnixStreamServer, SOAPServerBase): - if self.ssl_context: - sock = SSL.Connection(self.ssl_context, sock) - sock._setup_ssl(addr) - if sock.accept_ssl() != 1: - raise socket.error, "Couldn't accept SSL connection" + def __init__(self, addr = 8000, + RequestHandler = SOAPRequestHandler, log = 1, encoding = 'UTF-8', + config = Config, namespace = None, ssl_context = None): - return sock, addr + # Test the encoding, raising an exception if it's not known + if encoding != None: + ''.encode(encoding) - def registerObject(self, object, namespace = ''): - if namespace == '': namespace = self.namespace - self.objmap[namespace] = object + if ssl_context != None and not config.SSLserver: + raise AttributeError, \ + "SSL server not supported by this Python installation" - def registerFunction(self, function, namespace = '', funcName = None): - if not funcName : funcName = function.__name__ - if namespace == '': namespace = self.namespace - if self.funcmap.has_key(namespace): - self.funcmap[namespace][funcName] = function - else: - self.funcmap[namespace] = {funcName : function} + self.namespace = namespace + self.objmap = {} + self.funcmap = {} + self.ssl_context = ssl_context + self.encoding = encoding + self.config = config + self.log = log - def registerKWObject(self, object, namespace = ''): - if namespace == '': namespace = self.namespace - for i in dir(object.__class__): - if i[0] != "_" and callable(getattr(object, i)): - self.registerKWFunction(getattr(object,i), namespace) + self.allow_reuse_address= 1 - # convenience - wraps your func for you. - def registerKWFunction(self, function, namespace = '', funcName = None): - self.registerFunction(MethodSig(function,keywords=1), namespace, - funcName) + SocketServer.UnixStreamServer.__init__(self, str(addr), RequestHandler) |
|
From: <wa...@us...> - 2003-03-26 05:02:37
|
Update of /cvsroot/pywebsvcs/SOAPpy
In directory sc8-pr-cvs1:/tmp/cvs-serv21093
Modified Files:
CHANGELOG
Log Message:
- Updated to note addition of ieee754 module and changes enablein
MS-Windows support
Index: CHANGELOG
===================================================================
RCS file: /cvsroot/pywebsvcs/SOAPpy/CHANGELOG,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- CHANGELOG 25 Mar 2003 20:45:51 -0000 1.7
+++ CHANGELOG 26 Mar 2003 05:02:32 -0000 1.8
@@ -3,7 +3,16 @@
CHANGES SINCE VERSION 0.9.8
-- *** New argument handling method (via SOAPpy.SOAP.Config.specialArgs=1)
+- SOAPpy should now work properly on Microsoft Windows systems.
+
+ Previously, supporting platforms for which float('Inf') and similar
+ produced an error message ( notably Microsoft Windows) required an
+ ugly hack in the code which fails entirely under recent versions of
+ Python. A new module, ieee754 has been implemented which provides
+ functions to handle NaN, Inf, and -Inf, so SOAPPy should now work on
+ all platforms that use IEEE 754 double-precision floating point.
+
+- *** The new argument handling method (via SOAPpy.SOAP.Config.specialArgs=1)
is now enabled by default.***
- Changed all references to actzero.com in SOAP.py to pywebscvs.sf.net.
|
|
From: <wa...@us...> - 2003-03-26 04:51:04
|
Update of /cvsroot/pywebsvcs/SOAPpy/SOAPpy In directory sc8-pr-cvs1:/tmp/cvs-serv17473 Modified Files: SOAP.py Added Files: ieee754.py Log Message: - Added ieee754.py, which handles checking for IEEE 754 special values: Inf, -Inf, NaN, ... - Updated SOAP.py to use the new ieee754 module instead of the old (broken) windows hack. --- NEW FILE: ieee754.py --- """Utilities for handling IEEE 754 special values This class implements constants and functions for working with IEEE754 double-precision special values. It provides constants for NaN (Not a Number), NegInf (Negative Infinity), PosInf (Positive Infinity), and Inf (also Positive Infinity), as well as functions to test for these values. The code is implemented in pure python by taking advantage of the 'struck' standard module. Some efficiency could be gained by translating the core routines into C. See <http://babbage.cs.qc.edu/courses/cs341/IEEE-754references.html> for a description of the IEEE 754 floating point standard. Author: Gregory R. Warnes <gre...@gr...> Date:: 2003-03-25 Version 0.5.0 """ ident = "$Id: ieee754.py,v 1.1 2003/03/26 04:51:00 warnes Exp $" __version__ = "0.5.0" from struct import pack, unpack # check endianess _big_endian = pack('i',1)[0] != '\x01' # and define appropriate constants if(_big_endian): HW=0 LW=1 NaN = unpack('d', '\x7F\xFF\xFF\xFF\xFF\xFF\xFF\xFF')[0] Inf = unpack('d', '\x7F\xF0\x00\x00\x00\x00\x00\x00')[0] PosInf = Inf NegInf = -Inf else: HW=1 LW=0 NaN = unpack('d', '\x00\x00\x00\x00\x00\x00\xf8\xff')[0] Inf = unpack('d', '\x00\x00\x00\x00\x00\x00\xf0\x7f')[0] PosInf = Inf NegInf = -Inf def _double_as_longs(dval): "Use unpack to decode a double precision float into two long integers" tmp = unpack('ll',pack('d', dval)) return (tmp[HW], tmp[LW] ) ## ## Functions to extract components of the IEEE 754 floating point format ## def sign(dval): "Extract the sign bit from a double-precision floating point value" ll = _double_as_longs(dval) return ll[0] >> 31 & 0x01 def exponent(dval): """Extract the exponentent bits from a double-precision floating point value. Note that for normalized values, the exponentdent bits have an offset of 1023. As a consequence, the actual exponentent is obtained by subtracting 1023 for the value returned by this function """ ll = _double_as_longs(dval) return ( ll[0] >> 20 ) & 0x7ff def mantissa(dval): ll = _double_as_longs(dval) mantissa1 = ( ll[0] & 0xfffffL ) << 32 mantissa2 = ll[1] return mantissa1 + mantissa2 ## ## Functions to test for IEEE 754 special values ## def is_NaN(value): "Determine if the argument is a IEEE 754 NaN (Not a Number) value." return ( exponent(value)==0x7ff and mantissa(value)!=0 ) def is_Infinite(value): """Determine if the argument is an infinite IEEE 754 value (positive or negative inifinity)""" return ( exponent(value)==0x7ff and mantissa(value)== 0 ) def is_Finite(value): """Determine if the argument is an finite IEEE 754 value (i.e., is not NaN, positive or negative inifinity)""" return ( exponent(value)!=0x7ff ) def is_Inf(value): "Determine if the argument is a IEEE 754 positive infinity value" return ( sign(value)==0 and exponent(value)==0x7ff \ and mantissa(value)== 0 ) is_PosInf = is_Inf def is_NegInf(value): "Determine if the argument is a IEEE 754 negative infinity value" return ( sign(value)==1 and exponent(value)==0x7ff and \ mantissa(value)== 0 ) Index: SOAP.py =================================================================== RCS file: /cvsroot/pywebsvcs/SOAPpy/SOAPpy/SOAP.py,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- SOAP.py 25 Mar 2003 20:53:38 -0000 1.21 +++ SOAP.py 26 Mar 2003 04:51:00 -0000 1.22 @@ -94,6 +94,7 @@ import SocketServer from XMLname import toXMLname, fromXMLname from types import * +import ieee754 try: from M2Crypto import SSL except: pass @@ -102,16 +103,6 @@ __version__ = "0.9.9-pre1" -# Platform hackery - -# Check float support -try: - float("NaN") - float("INF") - float("-INF") - good_float = 1 -except: - good_float = 0 ################################################################################ # Exceptions @@ -1975,7 +1966,7 @@ if self._next == "E": if name[1] != 'Envelope': - raise Error, "expected `SOAP-ENV:Envelope', got `%s:%s'" % \ + raise Error, "expected `SOAP-ENV:Envelope', gto `%s:%s'" % \ (self._prem_r[name[0]], name[1]) if name[0] != NS.ENV: raise faultType, ("%s:VersionMismatch" % NS.ENV_T, @@ -2681,27 +2672,23 @@ if self.floatlimits.has_key (t[1]): l = self.floatlimits[t[1]] s = d.strip().lower() - try: - d = float(s) - except: - # Some platforms don't implement the float stuff. This - # is close, but NaN won't be > "INF" as required by the - # standard. - if s in ("nan", "inf"): - return 1e300**2 - if s == "-inf": - return -1e300**2 + if s == "nan": + return ieee754.NaN + elif s == "inf": + return ieee754.PosInf + elif s == "-inf": + return ieee754.NegInf - raise + d = float(s) - if str (d) == 'nan': + if str(d).lower() == 'nan': if s != 'nan': raise ValueError, "invalid %s" % t[1] - elif str (d) == '-inf': + elif str(d).lower() == '-inf': if s != '-inf': raise UnderflowError, "%s too small" % t[1] - elif str (d) == 'inf': + elif str(d).lower() == 'inf': if s != 'inf': raise OverflowError, "%s too large" % t[1] elif d < 0: @@ -3124,18 +3111,14 @@ "id": id, "attrs": a} def dump_float(self, obj, tag, typed = 1, ns_map = {}): - # Terrible windows hack - if not good_float: - if obj == float(1e300**2): - obj = "INF" - elif obj == float(-1e300**2): - obj = "-INF" - - obj = str(obj) - if obj in ('inf', '-inf'): - obj = str(obj).upper() - elif obj == 'nan': - obj = 'NaN' + if ieee754.is_PosInf(obj): + obj = "INF" + elif ieee754.is_NegInf(obj): + obj = "-INF" + elif ieee754.is_NaN(obj): + obj = "NaN" + else: + obj = str(obj) # Note: python 'float' is actually a SOAP 'double'. self.out.append(self.dumper(None, "double", obj, tag, typed, ns_map, |
|
From: <rs...@us...> - 2003-03-25 21:15:01
|
Update of /cvsroot/pywebsvcs/zsi/doc
In directory sc8-pr-cvs1:/tmp/cvs-serv27587
Modified Files:
Makefile c11-wsdl.tex
Log Message:
Merge in appropriate parts of Brian's original docs.
Index: Makefile
===================================================================
RCS file: /cvsroot/pywebsvcs/zsi/doc/Makefile,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- Makefile 21 Oct 2002 17:11:14 -0000 1.2
+++ Makefile 25 Mar 2003 21:14:53 -0000 1.3
@@ -8,7 +8,7 @@
CHAPTERS= c01-intro.tex c02-samples.tex c03-except.tex c04-utils.tex \
c05-parse.tex c06-tc.tex c07-writer.tex c08-fault.tex \
- c09-resolve.tex c10-dispatch.tex
+ c09-resolve.tex c10-dispatch.tex c11-wsdl.tex
M= zsi
Index: c11-wsdl.tex
===================================================================
RCS file: /cvsroot/pywebsvcs/zsi/doc/c11-wsdl.tex,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- c11-wsdl.tex 19 Mar 2003 19:14:19 -0000 1.1
+++ c11-wsdl.tex 25 Mar 2003 21:14:53 -0000 1.2
@@ -1,83 +1,695 @@
-\chapter{WSDL Services}
-
-
-\section{Using Web Services}
-
-The \module{ZSI.wsdl} package provides a high-level client-side tool
-for working with remote web services. The \class{ServiceProxy} class acts
-as a proxy for a service that has a WSDL description, and exposes methods
-that reflect the methods of the remote service. \class{ServiceProxy} objects
-are very straightforward - you initialize a proxy from a WSDL URL, then call
-methods on the proxy corresponding to the methods of the remote service.
-
-\begin{verbatim}
-from ZSI.wsdl import ServiceProxy
-
-service = ServiceProxy('http://www.xmethods.net/sd/BabelFishService.wsdl')
-value = service.BabelFish('en_de', 'This is a test!')
-\end{verbatim}
-
-The methods of \class{ServiceProxy} instances can be called with positional
-arguments (where the argument positions match the message descriptions in the
-associated WSDL) or keyword arguments (where the arguments match the message
-descriptions by name). Arguments to \class{ServiceProxy} methods must be
-compatible with the types required by the WSDL description.
-
-The return value from a proxy method depends on the SOAP signature. If the
-remote service returns a single value, that value will be returned. If the
-remote service returns multiple ``out'' parameters, the return value of the
-proxy method will be a dictionary containing the out parameters indexed by
-name. Complex return types are also supported, meaning an aggregation of
-primitives can be returned from a service invocation.
-
-\section{\module{ZSI.wsdl.ServiceProxy}}
-\declaremodule{}{ZSI.wsdl.ServiceProxy}
-
-The \module{ServiceProxy} module provides a convenient way to call
-remote web services that are described with WSDL. Service proxies
-expose methods that reflect the methods of the remote web service.
-
-
-\begin{classdesc}{ServiceProxy}{wsdl,\optional{, service\optional{, port}}}
-The \class{ServiceProxy} class provides a high-level Pythonic way to
-call remote web services. A WSDL description must be available for the
-remote service.
-
-The \var{wsdl} argument may be either the URL of the service description
-or an existing \class{WSDL} instance. The optional \var{service} and
-\var{port} name the service and port within the WSDL description that
-should be used. If not specified, the first defined service and port
-will be used.
-\end{classdesc}
-
-
-\subsection{ServiceProxy Objects}
-
-A \class{ServiceProxy} instance, once instantiated, exposes callable
-methods that reflect the methods of the remote web service it
-represents. These methods may be called like normal methods, using
-*either* positional or keyword arguments (but not both).
-
-When a method of a \class{ServiceProxy} is called with positional
-arguments, the arguments are mapped to the SOAP request based on
-the parameter order defined in the WSDL description. If keyword
-arguments are passed, the arguments will be mapped based on their
-names.
-
-
-\subsection{ServiceProxy Example}
-
-This example demonstrates instantiating a \class{ServiceProxy} object
-from a WSDL description to call a remote web service method. It should be
-noted that \class{ServiceProxy} supports the passing and receiving of complex
-types.
-
-\begin{verbatim}
-from WebService.ServiceProxy import ServiceProxy
-
-service = ServiceProxy('http://www.xmethods.net/sd/BabelFishService.wsdl')
-value = service.BabelFish('en_de', 'This is a test!')
-\end{verbatim}
-
-
-\end{document}
+\chapter{WSDL Services}
+
+The \module{ZSI.wsdl} module provides client tools for using WSDL 1.1
+(see \citetitle[http://www.w3.org/TR/wsdl]{WSDL 1.1 specification})
+files to access services.
+
+The \class{WSDLReader} class provides methods for loading WSDL service
+descriptions from URLs or XML data and creating a \class{WSDL} object.
+\class{WSDL} instances represent WSDL service descriptions and provide
+an object model for building and working with those descriptions.
+
+The \class{ServiceProxy} uses a \class{WSDL} instance to send
+and receive messages.
+Once the proxy has been created, each remote operation is exposed
+as a method on the object.
+The methods can be called with either positional or keyword arguments;
+the argument types must be compatible with the types specified in the
+WSDL description.
+
+The following example shows a simple language translation service:
+
+\begin{verbatim}
+from ZSI.wsdl import ServiceProxy
+
+service = ServiceProxy('http://www.xmethods.net/sd/BabelFishService.wsdl')
+value = service.BabelFish('en_de', 'This is a test!')
+\end{verbatim}
+
+The return value from a proxy method depends on the SOAP signature. If the
+remote service returns a single value, that value will be returned. If the
+remote service returns multiple ``out'' parameters, the return value of the
+proxy method will be a dictionary containing the out parameters indexed by
+name. Complex return types are also supported, meaning an aggregation of
+primitives can be returned from a service invocation.
+
+
+\begin{classdesc}{ServiceProxy}{wsdl,\optional{, service\optional{, port}}}
+The \class{ServiceProxy} class provides calls to
+web services. A WSDL description must be available for the
+service.
+
+The \var{wsdl} argument may be either the URL of the service description
+or an existing \class{WSDL} instance. The optional \var{service} and
+\var{port} name the service and port within the WSDL description that
+should be used. If not specified, the first defined service and port
+will be used.
+
+A \class{ServiceProxy} instance, once instantiated, exposes callable
+methods that reflect the methods of the remote web service it
+represents. These methods may be called like normal methods, using
+*either* positional or keyword arguments (but not both).
+
+When a method of a \class{ServiceProxy} is called with positional
+arguments, the arguments are mapped to the SOAP request based on
+the parameter order defined in the WSDL description. If keyword
+arguments are passed, the arguments will be mapped based on their
+names.
+
+\end{classdesc}
+
+\begin{classdesc}{WSDLReader}{}
+
+\class{WSDLReader} instances are used to load WSDL service descriptions
+from URLs, XML files or XML string data. The reader is implemented as a
+separate class to make it easy to create custom readers that implement
+caching policies or other optimizations.
+
+The following methods are available:
+
+\begin{methoddesc}{loadFromStream}{file}
+Return a \class{WSDL} instance representing the service description
+contained in \var{file}. The \var{file} argument must be a file-like
+object.
+\end{methoddesc}
+
+\begin{methoddesc}{loadFromString}{data}
+Returns a \class{WSDL} instance loaded from the XML string \var{data}.
+\end{methoddesc}
+
+\begin{methoddesc}{loadFromFile}{filename}
+Returns a \class{WSDL} instance loaded from the file named by \var{filename}.
+\end{methoddesc}
+
+\begin{methoddesc}{loadFromURL}{url}
+Returns a \class{WSDL} instance loaded from the given \var{url}.
+\end{methoddesc}
+
+\end{classdesc}
+
+\section{Upper-Level WSDL objects}
+
+The following classes describe encapsulate the upper-level objects
+in a WSDL file.
+
+Note that there are quite many classes defined here to
+implement the WSDL object model. Instances of those classes are generally
+accessed and created through container objects rather than instantiated
+directly. Most of them simply implement a straightforward representation of
+the WSDL elements they represent. The interfaces of these objects are
+described in the next section.
+
+An exception is defined for errors that occur while creating WSDL objects.
+
+\begin{excdesc}{WSDLError}
+This exception is raised when errors occur in the parsing or building of
+WSDL objects, usually indicating invalid structure or usage.
+It is a subtype of Python's \exception{Exception} class.
+\end{excdesc}
+
+\begin{classdesc}{WSDL}{}
+
+\class{WSDL} instances implement the WSDL object model. They are
+created by loading an XML source into a \class{WSDLReader} object.
+
+A \class{WSDL} object provides access to all of the structures that make
+up a web service description. The various ``collections'' in the WSDL
+object model (services, bindings, portTypes, etc.) are implemented as
+\class{Collection} objects that behave like ordered mappings.
+
+The following attributes are read-only:
+
+\begin{memberdesc}{name}
+The name of the service description (associated with the \emph{definitions}
+element), or \code{None} if not specified.
+\end{memberdesc}
+
+\begin{memberdesc}{targetNamespace}
+The target namespace associated with the service description, or
+\code{None} if not specified.
+\end{memberdesc}
+
+\begin{memberdesc}{documentation}
+The documentation associated with the \emph{definitions} element of the
+service description, or the empty string if not specified.
+\end{memberdesc}
+
+\begin{memberdesc}{location}
+The URL from which the service description was loaded, or \code{None}
+if the description was not loaded from a URL.
+\end{memberdesc}
+
+\begin{memberdesc}{services}
+A collection that contains \class{Service} objects that represent the
+services that appear in the service description. The items of this
+collection may be indexed by name or ordinal.
+\end{memberdesc}
+
+\begin{memberdesc}{messages}
+A collection that contains \class{Message} objects that represent the
+messages that appear in the service description. The items of this
+collection may be indexed by name or ordinal.
+\end{memberdesc}
+
+\begin{memberdesc}{portTypes}
+A collection that contains \class{PortType} objects that represent the
+portTypes that appear in the service description. The items of this
+collection may be indexed by name or ordinal.
+\end{memberdesc}
+
+\begin{memberdesc}{bindings}
+A collection that contains \class{Binding} objects that represent the
+bindings that appear in the service description. The items of this
+collection may be indexed by name or ordinal.
+\end{memberdesc}
+
+\begin{memberdesc}{imports}
+A collection that contains \class{ImportElement} objects that represent the
+import elements that appear in the service description. The items of this
+collection may be indexed by ordinal or the target namespace URI of the
+import element.
+\end{memberdesc}
+
+\begin{memberdesc}{types}
+A \class{Types} instance that contains \class{XMLSchema} objects that
+represent the schemas defined or imported by the WSDL description. The
+\class{Types} object may be indexed by ordinal or by targetNamespace to
+lookup schema objects.
+\end{memberdesc}
+
+\begin{memberdesc}{extensions}
+A sequence of objects that represent WSDL \emph{extension elements}. These
+objects may be instances of classes that represent WSDL-defined extensions
+(\class{SoapBinding}, \class{SoapBodyBinding}, etc.), or DOM \class{Element}
+objects for unknown extensions.
+\end{memberdesc}
+
+\end{classdesc}
+
+\begin{classdesc}{Service}{}
+A \class{Service} object represents a WSDL \code{<service>} element.
+
+The following attributes are read-only:
+
+\begin{memberdesc}{name}
+The name of the service.
+\end{memberdesc}
+
+\begin{memberdesc}{documentation}
+The documentation associated with the element, or an empty string.
+\end{memberdesc}
+
+\begin{memberdesc}{ports}
+A collection that contains \class{Port} objects that represent the
+ports defined by the service. The items of this collection may be indexed
+by name or ordinal.
+\end{memberdesc}
+
+\begin{memberdesc}{extensions}
+A sequence of any contained WSDL extensions.
+\end{memberdesc}
+
+The following method is available:
+
+\begin{methoddesc}{getWSDL}{}
+Return the parent \class{WSDL} instance of the object.
+\end{methoddesc}
+
+\end{classdesc}
+
+
+\begin{classdesc}{Port}{}
+
+A \class{Port} object represents a WSDL \code{<port>} element.
+
+The following attributes are read-only:
+
+\begin{memberdesc}{name}
+The name of the port.
+\end{memberdesc}
+
+\begin{memberdesc}{documentation}
+The documentation associated with the element, or an empty string.
+\end{memberdesc}
+
+\begin{memberdesc}{binding}
+The name of the binding associated with the port.
+\end{memberdesc}
+
+\begin{memberdesc}{extensions}
+A sequence of any contained WSDL extensions.
+\end{memberdesc}
+
+The following methods are available:
+
+\begin{methoddesc}{getAddressBinding}{}
+A convenience method that returns the address binding extension for the
+port, either a \class{SoapAddressBinding} or \class{HttpAddressBinding}.
+Raises \exception{WSDLError} if no address binding is found.
+\end{methoddesc}
+
+\begin{methoddesc}{getService}{}
+Return the parent \class{Service} instance of the object.
+\end{methoddesc}
+
+\begin{methoddesc}{getBinding}{}
+Return the \class{Binding} instance associated with the port.
+\end{methoddesc}
+
+\begin{methoddesc}{getPortType}{}
+Return the \class{PortType} instance associated with the port.
+\end{methoddesc}
+
+\end{classdesc}
+
+\begin{classdesc}{PortType}{}
+
+A \class{PortType} object represents a WSDL \code{<portType>} element.
+
+The following attributes are read-only:
+
+\begin{memberdesc}{name}
+The name of the portType.
+\end{memberdesc}
+
+\begin{memberdesc}{documentation}
+The documentation associated with the element, or an empty string.
+\end{memberdesc}
+
+\begin{memberdesc}{operations}
+A collection that contains \class{Operation} objects that represent the
+operations in the portType. The items of this collection may be indexed
+by name or ordinal.
+\end{memberdesc}
+
+The following method is available:
+
+\begin{methoddesc}{getWSDL}{}
+Return the parent \class{WSDL} instance of the object.
+\end{methoddesc}
+
+\end{classdesc}
+
+\begin{classdesc}{Operation}{}
+
+A \class{Operation} object represents a WSDL \code{<operation>} element
+within a \code{portType} element.
+
+The following attributes are read-only:
+
+\begin{memberdesc}{name}
+The name of the operation.
+\end{memberdesc}
+
+\begin{memberdesc}{documentation}
+The documentation associated with the element, or an empty string.
+\end{memberdesc}
+
+\begin{memberdesc}{parameterOrder}
+A string representing the \code{parameterOrder} attribute of the operation,
+or \code{None} if the attribute is not defined.
+\end{memberdesc}
+
+\begin{memberdesc}{input}
+A \class{MessageRole} instance representing the \code{<input>} element of
+the operation binding, or \code{None} if no input element is present.
+\end{memberdesc}
+
+\begin{memberdesc}{output}
+A \class{MessageRole} instance representing the \code{<output>} element of
+the operation, or \code{None} if no output element is present.
+\end{memberdesc}
+
+\begin{memberdesc}{faults}
+A collection of \class{MessageRole} instances representing the \code{<fault>}
+elements of the operation.
+\end{memberdesc}
+
+The following methods are available:
+
+\begin{methoddesc}{getPortType}{}
+Return the parent \class{PortType} instance of the object.
+\end{methoddesc}
+
+\begin{methoddesc}{getInputMessage}{}
+Return \class{Message} object associated with the input to the operation.
+\end{methoddesc}
+
+\begin{methoddesc}{getOutputMessage}{}
+Return \class{Message} object associated with the output of the operation.
+\end{methoddesc}
+
+\begin{methoddesc}{getFaultMessage}{name}
+Return \class{Message} object associated with the named fault.
+\end{methoddesc}
+
+\end{classdesc}
+
+\begin{classdesc}{MessageRole}{}
+
+\class{MessageRole} objects represent WSDL \code{<input>}, \code{<output>}
+and \code{<fault>} elements within an operation.
+
+The following attributes are read-only:
+
+\begin{memberdesc}{name}
+The name attribute of the element.
+\end{memberdesc}
+
+\begin{memberdesc}{type}
+The type of the element, one of \code{'input'}, \code{'output'} or
+\code{'fault'}.
+\end{memberdesc}
+
+\begin{memberdesc}{message}
+The name of the message associated with the object.
+\end{memberdesc}
+
+\begin{memberdesc}{documentation}
+The documentation associated with the element, or an empty string.
+\end{memberdesc}
+
+\end{classdesc}
+
+\begin{classdesc}{Binding}{}
+
+A \class{Binding} object represents a WSDL \code{<binding>} element.
+
+The following attributes are read-only:
+
+\begin{memberdesc}{name}
+The name of the binding.
+\end{memberdesc}
+
+\begin{memberdesc}{documentation}
+The documentation associated with the element, or an empty string.
+\end{memberdesc}
+
+\begin{memberdesc}{type}
+The name of the portType the binding is associated with.
+\end{memberdesc}
+
+\begin{memberdesc}{operations}
+A collection that contains \class{OperationBinding} objects that represent
+the contained operation bindings.
+\end{memberdesc}
+
+\begin{memberdesc}{extensions}
+A sequence of any contained WSDL extensions.
+\end{memberdesc}
+
+The following methods are available:
+
+\begin{methoddesc}{getWSDL}{}
+Return the parent \class{WSDL} instance of the object.
+\end{methoddesc}
+
+\begin{methoddesc}{getPortType}{}
+Return the \class{PortType} object associated with the binding.
+\end{methoddesc}
+
+\begin{methoddesc}{findBinding}{kind}
+Find a binding extension in the binding. The \var{kind} can be a class
+object if the wanted extension is one of the WSDL-defined types (such as
+\class{SoapBinding} or \class{HttpBinding}). If the extension is not one of
+the supported types, \var{kind} can be a tuple of the form
+\code{(namespace-URI, localname)}, which will be used to try to find a
+matching DOM \class{Element}.
+\end{methoddesc}
+
+\begin{methoddesc}{findBindings}{kind}
+The same as \method{findBinding()}, but will return multiple values of
+the given \var{kind}.
+\end{methoddesc}
+
+\end{classdesc}
+
+\begin{classdesc}{OperationBinding}{}
+
+A \class{OperationBinding} object represents a WSDL \code{<operation>}
+element within a binding element.
+
+The following attributes are read-only:
+
+\begin{memberdesc}{name}
+The name of the operation binding.
+\end{memberdesc}
+
+\begin{memberdesc}{documentation}
+The documentation associated with the element, or an empty string.
+\end{memberdesc}
+
+\begin{memberdesc}{input}
+A \class{MessageRoleBinding} instance representing the \code{<input>}
+element of the operation binding, or \code{None} if no input element is
+present.
+\end{memberdesc}
+
+\begin{memberdesc}{output}
+A \class{MessageRoleBinding} instance representing the \code{<output>}
+element of the operation binding, or \code{None} if no output element is
+present.
+\end{memberdesc}
+
+\begin{memberdesc}{faults}
+A collection of \class{MessageRoleBinding} instances representing the
+\code{<fault>} elements of the operation binding.
+\end{memberdesc}
+
+\begin{memberdesc}{extensions}
+A sequence of any contained WSDL extensions.
+\end{memberdesc}
+
+The following methods are available:
+
+\begin{methoddesc}{getBinding}{}
+Return the parent \class{Binding} instance of the operation binding.
+\end{methoddesc}
+
+\begin{methoddesc}{getOperation}{}
+Return the abstract \class{Operation} associated with the operation binding.
+\end{methoddesc}
+
+\begin{methoddesc}{findBinding}{kind}
+Find a binding extension in the operation binding. The \var{kind} can be a
+class object if the wanted extension is one of the WSDL-defined types (such
+as \class{SoapOperationsBinding} or \class{HttpOperationBinding}).
+
+If the extension is not one of the supported types, \var{kind} can be a
+tuple of the form \code{(namespace-URI, localname)}, which will be used to
+try to find a matching DOM \class{Element}.
+\end{methoddesc}
+
+\begin{methoddesc}{findBindings}{kind}
+The same as \method{findBinding()}, but will return multiple values of
+the given \var{kind}.
+\end{methoddesc}
+
+\end{classdesc}
+
+
+\begin{classdesc}{MessageRoleBinding}{}
+
+\class{MessageRoleBinding} objects represent WSDL \code{<input>},
+\code{<output>} and \code{<fault>} elements within an operation binding.
+
+The following attributes are read-only:
+
+\begin{memberdesc}{name}
+The name attribute of the element, for fault elements. This is always
+\code{None} for input and output elements.
+\end{memberdesc}
+
+\begin{memberdesc}{type}
+The type of the element, one of \code{'input'}, \code{'output'} or
+\code{'fault'}.
+\end{memberdesc}
+
+\begin{memberdesc}{documentation}
+The documentation associated with the element, or an empty string.
+\end{memberdesc}
+
+\begin{memberdesc}{extensions}
+A sequence of any contained WSDL extensions.
+\end{memberdesc}
+
+The following methods are available:
+
+\begin{methoddesc}{findBinding}{kind}
+Find a binding extension in the message role binding. The \var{kind} can be a
+class object if the wanted extension is one of the WSDL-defined types.
+
+If the extension is not one of the supported types, \var{kind} can be a
+tuple of the form \code{(namespace-URI, localname)}, which will be used to
+try to find a matching DOM \class{Element}.
+\end{methoddesc}
+
+\begin{methoddesc}{findBindings}{kind}
+The same as \method{findBinding()}, but will return multiple values of
+the given \var{kind}.
+\end{methoddesc}
+
+\end{classdesc}
+
+
+\begin{classdesc}{Message}{}
+
+A \class{Message} object represents a WSDL \code{<message>} element.
+
+The following attributes are read-only:
+
+\begin{memberdesc}{name}
+The name of the message.
+\end{memberdesc}
+
+\begin{memberdesc}{documentation}
+The documentation associated with the element, or an empty string.
+\end{memberdesc}
+
+\begin{memberdesc}{parts}
+A collection that contains \class{MessagePart} objects that represent the
+parts of the message. The items of this collection may be indexed
+by name or ordinal.
+\end{memberdesc}
+\end{classdesc}
+
+
+\begin{classdesc}{MessagePart}{}
+
+A \class{MessagePart} object represents a WSDL \code{<part>} element.
+
+The following attributes are read-only:
+
+\begin{memberdesc}{name}
+The name of the message part.
+\end{memberdesc}
+
+\begin{memberdesc}{documentation}
+The documentation associated with the element, or an empty string.
+\end{memberdesc}
+
+\begin{memberdesc}{type}
+A tuple of the form \code{(namespace-URI, localname)}, or \code{None}
+if the \member{type} attribute is not defined.
+\end{memberdesc}
+
+\begin{memberdesc}{element}
+A tuple of the form \code{(namespace-URI, localname)}, or \code{None}
+if the \member{element} attribute is not defined.
+\end{memberdesc}
+\end{classdesc}
+
+
+\begin{classdesc}{Types}{}
+
+The following attributes are read-only:
+
+A \class{Types} object represents a WSDL \code{<types>} element. It acts
+as an ordered collection containing \class{XMLSchema} instances associated
+with the service description (either directly defined in a \code{<types>}
+element, or included via import). The \class{Types} object can be indexed
+by ordinal or by the \code{targetNamespace} of the contained schemas.
+
+\begin{memberdesc}{documentation}
+The documentation associated with the element, or an empty string.
+\end{memberdesc}
+
+\begin{memberdesc}{extensions}
+A sequence of any contained WSDL extensions.
+\end{memberdesc}
+
+The following method is available:
+
+\begin{methoddesc}{getWSDL}{}
+Return the parent \class{WSDL} instance of the object.
+\end{methoddesc}
+\end{classdesc}
+
+\begin{classdesc}{ImportElement}{}
+
+A \class{ImportElement} object represents a WSDL \code{<import>} element.
+
+The following attributes are read-only:
+
+\begin{memberdesc}{namespace}
+The namespace attribute of the import element.
+\end{memberdesc}
+
+The following method is available:
+
+\begin{memberdesc}{location}
+The location attribute of the import element.
+\end{memberdesc}
+\end{classdesc}
+
+
+\section{Binding Classes}
+
+The \module{WSDLTools} module contains a number of classes that represent
+the binding extensions defined in the WSDL specification. These classes
+are straightforward, reflecting the attributes of the corresponding
+XML elements, so they are not documented exhaustively here.
+
+\begin{classdesc}{SoapBinding}{transport\optional{, style}}
+Represents a \code{<soap:binding>} element.
+\end{classdesc}
+
+\begin{classdesc}{SoapAddressBinding}{location}
+Represents a \code{<soap:address>} element.
+\end{classdesc}
+
+\begin{classdesc}{SoapOperationBinding}{}
+Represents a \code{<soap:operation>} element.
+\end{classdesc}
+
+\begin{classdesc}{SoapBodyBinding}{}
+Represents a \code{<soap:body>} element.
+\end{classdesc}
+
+\begin{classdesc}{SoapFaultBinding}{}
+Represents a \code{<soap:fault>} element.
+\end{classdesc}
+
+\begin{classdesc}{SoapHeaderBinding}{}
+Represents a \code{<soap:header>} element.
+\end{classdesc}
+
+\begin{classdesc}{SoapHeaderFaultBinding}{}
+Represents a \code{<soap:headerfault>} element.
+\end{classdesc}
+
+\begin{classdesc}{HttpBinding}{}
+Represents a \code{<http:binding>} element.
+\end{classdesc}
+
+\begin{classdesc}{HttpAddressBinding}{}
+Represents a \code{<http:address>} element.
+\end{classdesc}
+
+\begin{classdesc}{HttpOperationBinding}{}
+Represents a \code{<http:operation>} element.
+\end{classdesc}
+
+\begin{classdesc}{HttpUrlReplacementBinding}{}
+Represents a \code{<http:urlReplacement>} element.
+\end{classdesc}
+
+\begin{classdesc}{HttpUrlEncodedBinding}{}
+Represents a \code{<http:urlEncoded>} element.
+\end{classdesc}
+
+\begin{classdesc}{MimeMultipartRelatedBinding}{}
+Represents a \code{<mime:multipartRelated>} element.
+\end{classdesc}
+
+\begin{classdesc}{MimePartBinding}{}
+Represents a \code{<mime:part>} element.
+\end{classdesc}
+
+\begin{classdesc}{MimeContentBinding}{}
+Represents a \code{<mime:content>} element.
+\end{classdesc}
+
+\begin{classdesc}{MimeXmlBinding}{}
+Represents a \code{<mime:mimeXml>} element.
+\end{classdesc}
|
|
From: <wa...@us...> - 2003-03-25 20:53:48
|
Update of /cvsroot/pywebsvcs/SOAPpy/SOAPpy In directory sc8-pr-cvs1:/tmp/cvs-serv19308/SOAPpy Modified Files: SOAP.py Log Message: - Reversed version string to 0.9.9-pre1. Index: SOAP.py =================================================================== RCS file: /cvsroot/pywebsvcs/SOAPpy/SOAPpy/SOAP.py,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- SOAP.py 25 Mar 2003 20:45:54 -0000 1.20 +++ SOAP.py 25 Mar 2003 20:53:38 -0000 1.21 @@ -100,7 +100,7 @@ ident = '$Id$' -__version__ = "0.9.9" +__version__ = "0.9.9-pre1" # Platform hackery |
|
From: <wa...@us...> - 2003-03-25 20:46:01
|
Update of /cvsroot/pywebsvcs/SOAPpy In directory sc8-pr-cvs1:/tmp/cvs-serv15059 Modified Files: CHANGELOG README.MethodParameterNaming Log Message: - specialArgs handling is now enabled by default. Index: CHANGELOG =================================================================== RCS file: /cvsroot/pywebsvcs/SOAPpy/CHANGELOG,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- CHANGELOG 12 Mar 2003 07:38:18 -0000 1.6 +++ CHANGELOG 25 Mar 2003 20:45:51 -0000 1.7 @@ -1,6 +1,17 @@ SOAP.py +CHANGES SINCE VERSION 0.9.8 + +- *** New argument handling method (via SOAPpy.SOAP.Config.specialArgs=1) + is now enabled by default.*** + +- Changed all references to actzero.com in SOAP.py to pywebscvs.sf.net. + +- Fixed a bug where lists included as parameters to SOAP method calls + were being incorrectly named 'Results' even when another name was + given. + CHANGES SINCE VERSION 0.9.7 - Modified structure to allow installation using Python distutils @@ -42,7 +53,7 @@ - Add basic authentication (Brad Knotwell) -- Fixes to enble proper handling of SOAP faults by the client: +- Fixes to enable proper handling of SOAP faults by the client: - Fixed test of whether message content is text/xml when recieving a fault. - Added __call__ method to exception classes to match the current API. - The faultType.__repr__() method now print details if present Index: README.MethodParameterNaming =================================================================== RCS file: /cvsroot/pywebsvcs/SOAPpy/README.MethodParameterNaming,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- README.MethodParameterNaming 8 Mar 2003 05:00:33 -0000 1.1 +++ README.MethodParameterNaming 25 Mar 2003 20:45:53 -0000 1.2 @@ -19,10 +19,10 @@ communicating with a SOAPpy server. First, when named arguments were used in call to a non-flagged function, the argument would silently be reordered by the sender (since they were stored using a Python -dictionary), *and* the names would be ignored by the reciever, which +dictionary), *and* the names would be ignored by the receiver, which assumed that the parameters were unnamed and only the order was significant. This results in incorrect argument matching. This -problem also occured with mixed named and unnamed arguments. +problem also occurred with mixed named and unnamed arguments. For my primary SOAP application, it is not reasonable to flag all of the SOAPpy methods as requiring named arguments, for a variety of @@ -34,14 +34,15 @@ In an attempt to overcome this problem, I have implemented an experimental and non-standard method of handling named and unnamed arguments. This mechanism is enabled in SOAPpy by setting -SOAPpy.SOAP.Config.specialArgs=1. +SOAPpy.SOAP.Config.specialArgs=1, and disabled by setting SOAPpy.SOAP.Config.specialArgs=0. When enabled, parameters with names of the form _#### (i.e., matching the regexp "^_[0-9]+") are assumed to be unnamed parameters and are passed to the method in numeric order. All other parameters are assumed to be named and are passed using the name. Outgoing SOAP method calls now always generate names in this way--whether or not -specialArgs is enabled--instead of using the pattern v#####. +specialArgs is enabled. (Previously, unnamed arguments were given +names of the form v#####.) I selected the form _#### because it is a valid XML name, but is unlikely to be used as a parameter name. @@ -50,12 +51,11 @@ works fine between a SOAPpy client and a SOAPpy server, and resolves the parameter reordering problems I was experiencing. This system seems unlikely to have any negative side effects on other SOAP -applications, except in the (hopefully) rare case when _#### might abe -used as an actual parameter name. - -For the moment, this feature is disabled by default, but I will -consider changing the default in a future release. +applications, except in the (hopefully) rare case when _#### might be +used as an actual parameter name. +**In version 0.9.9-pre1, this feature is enabled by default.** Please +let me know if there are situations where this causes problems. Note that this mechanism is only a partial solution, since it is still impossible to return named parameters in a specified order using @@ -63,5 +63,5 @@ feature are simply not compatible with SOAPpy. -Greg Warnes <gre...@gr...> -2003-03-07 +2003-03-07 (updated 2003-03-25) |
|
From: <wa...@us...> - 2003-03-25 20:46:00
|
Update of /cvsroot/pywebsvcs/SOAPpy/SOAPpy
In directory sc8-pr-cvs1:/tmp/cvs-serv15059/SOAPpy
Modified Files:
SOAP.py
Log Message:
- specialArgs handling is now enabled by default.
Index: SOAP.py
===================================================================
RCS file: /cvsroot/pywebsvcs/SOAPpy/SOAPpy/SOAP.py,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- SOAP.py 25 Mar 2003 17:53:38 -0000 1.19
+++ SOAP.py 25 Mar 2003 20:45:54 -0000 1.20
@@ -1,10 +1,11 @@
#!/usr/bin/python
+"""
################################################################################
#
-# SOAP.py 0.9.8 - Cayce Ullman (ca...@ac...)
-# Brian Matthews (bl...@ac...)
-# Gregory Warnes (gre...@gr...)
-# Christopher Blunck (bl...@gs...)
+# SOAPpy - Cayce Ullman (ca...@ac...)
+# Brian Matthews (bl...@ac...)
+# Gregory Warnes (gre...@gr...)
+# Christopher Blunck (bl...@gs...)
#
# INCLUDED:
# - General SOAP Parser based on sax.xml (requires Python 2.0)
@@ -76,6 +77,8 @@
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
################################################################################
+"""
+
import xml.sax
import UserList
import base64
@@ -97,7 +100,7 @@
ident = '$Id$'
-__version__ = "0.9.8"
+__version__ = "0.9.9"
# Platform hackery
@@ -226,7 +229,10 @@
self.buildWithNamespacePrefix = 1
self.returnAllAttrs = 0
- self.specialArgs = 0
+
+ # New argument name handling mechanism. See
+ # README.MethodParameterNaming for details
+ self.specialArgs = 1
try: SSL; d['SSLserver'] = 1
except: d['SSLserver'] = 0
|
|
From: <wa...@us...> - 2003-03-25 20:26:55
|
Update of /cvsroot/pywebsvcs/SOAPpy
In directory sc8-pr-cvs1:/tmp/cvs-serv8237
Modified Files:
setup.py
Log Message:
- Modified setup.py to get version number directly from
SOAPpy/SOAP.py's __version__ variable.
Index: setup.py
===================================================================
RCS file: /cvsroot/pywebsvcs/SOAPpy/setup.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- setup.py 12 Mar 2003 07:47:59 -0000 1.3
+++ setup.py 25 Mar 2003 20:26:47 -0000 1.4
@@ -4,10 +4,11 @@
long_description="SOAPpy provides tools for building SOAP clients and servers. For more information see " + url
+from SOAPpy import SOAP
+
setup(name="SOAPpy",
- version="0.9.8",
+ version=SOAP.__version__,
description="SOAP Services for Python",
- author="Cayce Ullman, Brian Matthews, Gregory Warnes, Christopher Blunck",
maintainer="Gregory Warnes",
maintainer_email="gre...@gr...",
url = url,
|
|
From: <rs...@us...> - 2003-03-25 19:02:14
|
Update of /cvsroot/pywebsvcs/zsi/ZSI/wsdl
In directory sc8-pr-cvs1:/tmp/cvs-serv3315
Modified Files:
WSDLTools.py
Log Message:
Use some list comprehensions
Index: WSDLTools.py
===================================================================
RCS file: /cvsroot/pywebsvcs/zsi/ZSI/wsdl/WSDLTools.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- WSDLTools.py 21 Mar 2003 16:31:25 -0000 1.2
+++ WSDLTools.py 25 Mar 2003 19:02:00 -0000 1.3
@@ -35,15 +35,17 @@
wsdl.load(document)
return wsdl
- def loadFromString(self, data, checksum=None):
+ def loadFromString(self, data):
"""Return a WSDL instance loaded from an xml string."""
- return self.loadFromStream(StringIO(data), checksum)
+ return self.loadFromStream(StringIO(data))
- def loadFromFile(self, filename, checksum=None):
+ def loadFromFile(self, filename):
"""Return a WSDL instance loaded from the given file."""
file = open(filename, 'rb')
- try: wsdl = self.loadFromStream(file, checksum)
- finally: file.close()
+ try:
+ wsdl = self.loadFromStream(file)
+ finally:
+ file.close()
return wsdl
class WSDL:
@@ -461,11 +463,7 @@
return None
def findBindings(self, kind):
- result = []
- for item in self.extensions:
- if isinstance(item, kind):
- result.append(item)
- return result
+ return [ item for item in self.extensions if isinstance(item, kind) ]
def addOperationBinding(self, name, documentation=''):
item = OperationBinding(name, documentation)
@@ -540,11 +538,7 @@
return None
def findBindings(self, kind):
- result = []
- for item in self.extensions:
- if isinstance(item, kind):
- result.append(item)
- return result
+ return [ item for item in self.extensions if isinstance(item, kind) ]
def addInputBinding(self, binding):
if self.input is None:
@@ -595,11 +589,7 @@
return None
def findBindings(self, kind):
- result = []
- for item in self.extensions:
- if isinstance(item, kind):
- result.append(item)
- return result
+ return [ item for item in self.extensions if isinstance(item, kind) ]
def load_ex(self, elements):
for e in elements:
@@ -932,40 +922,29 @@
return ''
def GetExtensions(element):
- result = []
- for item in DOM.getElements(element, None, None):
- if item.namespaceURI != DOM.NS_WSDL:
- result.append(item)
- return result
+ return [ item for item in DOM.getElements(element, None, None)
+ if item.namespaceURI != DOM.NS_WSDL ]
def FindExtensions(object, kind, t_type=type(())):
- result = []
if isinstance(kind, t_type):
+ result = []
namespaceURI, name = kind
- for item in object.extensions:
- if not hasattr(item, 'nodeType'):
- continue
- if DOM.nsUriMatch(namespaceURI, item.namespaceURI) and \
- item.name == name:
- result.append(item)
- else:
- for item in object.extensions:
- if isinstance(item, kind):
- result.append(item)
- return result
+ return [ item for item in object.extensions
+ if hasattr(item, 'nodeType') \
+ and DOM.nsUriMatch(namespaceURI, item.namespaceURI) \
+ and item.name == name ]
+ return [ item for item in object.extensions if isinstance(item, kind) ]
def FindExtension(object, kind, t_type=type(())):
if isinstance(kind, t_type):
namespaceURI, name = kind
for item in object.extensions:
- if not hasattr(item, 'nodeType'):
- continue
- if DOM.nsUriMatch(namespaceURI, item.namespaceURI) and \
- item.name == name:
+ if hasattr(item, 'nodeType') \
+ and DOM.nsUriMatch(namespaceURI, item.namespaceURI) \
+ and item.name == name:
return item
else:
for item in object.extensions:
if isinstance(item, kind):
return item
return None
-
|
|
From: <rs...@us...> - 2003-03-25 18:14:55
|
Update of /cvsroot/pywebsvcs/zsi/doc
In directory sc8-pr-cvs1:/tmp/cvs-serv14066/doc
Modified Files:
zsi.tex
Log Message:
Output XML prolog in SOAPWriter.
Add proper co-author credit.
Index: zsi.tex
===================================================================
RCS file: /cvsroot/pywebsvcs/zsi/doc/zsi.tex,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- zsi.tex 19 Mar 2003 20:14:58 -0000 1.10
+++ zsi.tex 25 Mar 2003 18:14:17 -0000 1.11
@@ -5,8 +5,7 @@
\author{Rich Salz,\\
Christopher Blunck}
\authoraddress{
-\strong{DataPower Technology, \url{http://www.datapower.com}}\\
-E-mail: \email{rs...@da...\\
+\email{rs...@da...\\
bl...@gs...}
}
\date{March 19, 2003}% edited date, not printed date
|
|
From: <rs...@us...> - 2003-03-25 18:14:50
|
Update of /cvsroot/pywebsvcs/zsi/ZSI
In directory sc8-pr-cvs1:/tmp/cvs-serv14066/ZSI
Modified Files:
writer.py
Log Message:
Output XML prolog in SOAPWriter.
Add proper co-author credit.
Index: writer.py
===================================================================
RCS file: /cvsroot/pywebsvcs/zsi/ZSI/writer.py,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- writer.py 10 Feb 2003 17:12:18 -0000 1.10
+++ writer.py 25 Mar 2003 18:14:15 -0000 1.11
@@ -35,6 +35,7 @@
self.encoding = encoding
if not self.envelope: return
+ print >>self, '<?xml version="1.0" encoding="utf-8"?>'
print >>self, '<SOAP-ENV:Envelope\n' \
' xmlns:SOAP-ENV="%(SOAP-ENV)s"\n' \
' xmlns:SOAP-ENC="%(SOAP-ENC)s"\n' \
|
|
From: <rs...@us...> - 2003-03-25 18:14:49
|
Update of /cvsroot/pywebsvcs/zsi
In directory sc8-pr-cvs1:/tmp/cvs-serv14066
Modified Files:
CHANGES
Log Message:
Output XML prolog in SOAPWriter.
Add proper co-author credit.
Index: CHANGES
===================================================================
RCS file: /cvsroot/pywebsvcs/zsi/CHANGES,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- CHANGES 25 Mar 2003 04:13:04 -0000 1.21
+++ CHANGES 25 Mar 2003 18:14:14 -0000 1.22
@@ -1,4 +1,5 @@
Changes for ??, released ???:
+ - Ouput XML prolog in SoapWriter
- Added nsdict parameter to dispatch.AsCGI and dispatch.AsServer
- Fixed bug where xmlns attribute was included in closing elements
- Added support for "wrapped" complexTypes in response messages
|
|
From: <wa...@us...> - 2003-03-25 17:53:52
|
Update of /cvsroot/pywebsvcs/SOAPpy/SOAPpy In directory sc8-pr-cvs1:/tmp/cvs-serv4731/SOAPpy Modified Files: SOAP.py Log Message: - Changed all references from actzero.com to pywebsvcs.sf.net. Index: SOAP.py =================================================================== RCS file: /cvsroot/pywebsvcs/SOAPpy/SOAPpy/SOAP.py,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- SOAP.py 25 Mar 2003 17:02:26 -0000 1.18 +++ SOAP.py 25 Mar 2003 17:53:38 -0000 1.19 @@ -1,7 +1,7 @@ #!/usr/bin/python ################################################################################ # -# SOAP.py 0.9.7 - Cayce Ullman (ca...@ac...) +# SOAP.py 0.9.8 - Cayce Ullman (ca...@ac...) # Brian Matthews (bl...@ac...) # Gregory Warnes (gre...@gr...) # Christopher Blunck (bl...@gs...) @@ -3484,7 +3484,7 @@ debugHeader(s) print "POST %s %s" % (real_path, r._http_vsn_str) print "Host:", addr.host - print "User-agent: SOAP.py " + __version__ + " (actzero.com)" + print "User-agent: SOAP.py " + __version__ + " (http://pywebsvcs.sf.net)" print "Content-type:", t print "Content-length:", len(data) print 'SOAPAction: "%s"' % soapaction @@ -3762,7 +3762,7 @@ class SOAPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler): def version_string(self): - return '<a href="http://www.actzero.com/solution.html">' + \ + return '<a href="http://pywebsvcs.sf.net">' + \ 'SOAP.py ' + __version__ + '</a> (Python ' + \ sys.version.split()[0] + ')' |