SOAP Services for Python
SOAPpy provides tools for building SOAP clients and servers. For more information see https://github.com/kiorky/SOAPpy.git
Copyright (c) 20011 Makina Corpus Copyright (c) 2002-2005, Pfizer, Inc. Copyright (c) 2001, Cayce Ullman. Copyright (c) 2001, Brian Matthews. All rights reserved, see the file LICENSE for conditions of use.
The goal of the SOAPpy team is to provide a full-featured SOAP library for Python that is very simple to use and that fully supports dynamic interaction between clients and servers.
Files README This file RELEASE_NOTES General information about each release ChangeLog Detailed list of changes TODO List of tasks that need to be done setup.py Python installation control files SOAPpy.spec RPM package control file Directories SOAPpy/ Source code for the package SOAPpy/wstools/ Source code for WSDL tools tests/ unit tests and examples validate/ interop client and servers bid/ N+I interop client and server contrib/ Contributed examples (also see test/) docs/ Documentation tools/ Misc tools useful for the SOAPpy developers zope/ Patches to Zope allowing it to provide SOAP services
You can install SOAPpy and its dependencies directly from GitHub using PIP:pip install -e “git+http://github.com/kiroky/SOAPpy.git@develop#egg=SOAPpy”
As of version 0.9.8 SOAPpy can be installed using the standard python package installation tools.
Unpack the distribution package:
On Windows, use your favorite zip file uncompression tool.
On Unix:$ tar -xvzf SOAPpy-$VERSION$.tar.gz
- If you have gnu tar, otherwise
- $ gzcat SOAPpy-$VERSION$.tar.gz | tar -xvf -
Change into the source directorycd SOAPpy-$VERSION$
Compile the package:$ python setup.py build
Install the package
On Windows:$ python setup.py install
On Unix install as the owner of the python directories (usally root):$ su root Password: XXXXXX $ python setup.py install
A simple “Hello World” http SOAP server:
import SOAPpy def hello(): return "Hello World" server = SOAPpy.SOAPServer(("localhost", 8080)) server.registerFunction(hello) server.serve_forever()
And the corresponding client:
import SOAPpy server = SOAPpy.SOAPProxy("http://localhost:8080/") print server.hello()
Mark Pilgrims _Dive Into Python, published in printed form by Apress and online at at http://diveintopython.org provides a nice tutorial for SOAPpy in Chapter 12, “SOAP Web Services”. See http://diveintopython.org/soap_web_services .
For further information see the files in the docs/ directory.
Note that documentation is one of SOAPpy’s current weak points. Please help us out!
main interresting enhancements grabbed:
- from __future__ imports must occur at the beginning of the file
- try install requires
Grabbed others changeset from https://bitbucket.org/cmclaughlin/soappy-0.12.0/ (fpconst)
Grabbed others changeset from https://bitbucket.org/zeus/soappy (ssl key support)
Depend directly on wstools not to bundle a duplicated version.
Grabbed from original svn:
- rpm spec file
- .cvsignore files
Make it proper packaged, specially toward setuptools.
This release primarily foces on bug fixes. Primary changes:
Fixes for bug reports that have accumulated over the last year
[ 916265] “Arrays of unicode do not serialize correctly (patch included)” [ 918216] “Parsing faults in SOAPpy 0.11.3” [ 925077] “SOAPpy prints out SOAP fault” (even when Config.debug is off).  “SOAPpy stomps headers when sending multirefs”  “SOAPpy stomps headers when sending multirefs.  “Bug fixes for complex types”  “Bugs in _asdict() and _asarray() in Types.py”  “Arrays of complex types (doc/lit)”  “Parse error: missing HTTP header ‘Content-length’”  “Floats are truncated to 10 digits, causing precision loss”  “error from SOAPpy/Client.py for content_length evaluation?”
Fixes for ‘rules’ which allow control of the data types of incoming messages. As a consequence TCtest.py now passes all tests.
WSDL support has been improving, due to work on the ‘wstools’ module which is shared between ZSI and SOAPpy.
Some work has been done to improve documentation.
Changes to URLs and email addresses in documentation.
- Fix string format error in fault handling
- SOAPpy/Server.py: Check if header information contains SOAPAction
- key before checking its value.
- Fixes for generating SOAP from complexType arrays, contributed by firstname.lastname@example.org
- Fixed bug that caused typedArrayTypes to lose their type information when rendered to SOAP and added corresponding test case.
- Enhancements to fault handling: The faultType Faultstring is now a non-variable string (i.e. no nsmethod in it) so that it can be programmatically checked. In addition fault handlers can now be registered to handle specific types of faults.
- SOAPpy/Server.py: Modified unregsiterObject function to take optional namespace/path args to be consistent with registerObject.
- SOAPpy/Server.py: Added an unregisterObject function
- Changes to allow SOAPBuilder so it can handle a ‘raw’ Python object.
Ivan R. Judson has joined the SOAPpy team. He is focused on Globus support but is also responsible for a lot of other work for this release,
- Code in Types.py assumes nested scopes, so I added the proper import so this will work under python 2.2.x
- Fixing namespace collision
- Fixed handing of named arguments bug introduced in 0.11.1.
- Fix memory leak when exceptions are raised.
- Fix bug when content-length is not present in parsed SOAP message.
- Fix bug #888345: Python 2.3 boolean type serialized as int
- Fix bug #875977: no escaping of bad tagnames for NoneTypes
- Improved Globus support and documentation. Thanks Ivan!
- Added context handling
- Changed the use of SOAPAction, it used to default to setting it to “”, now it defaults to setting it to the method (not the nsmethod). There is a clause in Server.py that catches ‘old style’ SOAPActions (aka “”) and sets them to the method. When this is confirmed to be what everyone wants and we decide it’s alright to (possibly) break client/server interop, we can take the clause out of Server.py and just handle SOAPActions of “” as a possible error/warning.
- Additional test code.
- Raise a SOAPException instead of returning a SOAPpy.faultType when a SOAP Fault is encountered and simplify_objects is enabled.
- Fixed bug [ 792258 ] “SOAPBuilder.SOAPBuilder.dump can catch wrong exceptions” in SOAPBuilder.dump() submitted by Greg Chapman (glchapman).
- Changes suggested by Richard Au (richardau) to fix ssl support. See bug report [ 752882 ] “SSL SOAP Server no longer working.”
- Remove call to gentag from ‘dump’ and add to ‘dump_float’, per bug report [ 792600 ] “SOAPBuilder.SOAPBuilder.dump possibly should not call gentag” by Greg Chapman (glchapman).
- Add a tests for handling of nil=”true” and nil=”false”. This fixes bug [ pywebsvcs-Bugs-858168 ] ‘xsi:nil=”true” causes exception’ reported by Robert Zimmermann (robertzett):
testClient1.py now works properly. It had been failing to start the server thread on the second unit test. It turned out that the variable ‘quit’ needed to be reset to zero after the SOAP server thread for the first unit test exited. With the solution of this problem testClient1 can now be extended to run unit tests of both client and server components.
Added ‘strict’ option to the WSDL class. If strict is true, a RuntimeException will be raised if an unrecogned message is recieved. If strict is false, a warning will be printed to the console, the message type will be added to the WSDL schema, and processing will continue. This is in response to the second half of bug report [ 817331 ] “Some WSDL.py changes”, submitted by Rudolf Ruland.
Dramatic performance improvements for large data transfers.
only minor changes
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.
MS-Windows systems should now be fully supported.
This required implementing 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.
Code reorganization: The huge file SOAPpy/SOAP.py (4,122 lines, 131K) has been split into 10 separate files. In addition code shared with ZSI has been moved into a separate subdirectory and a separate CVS module.
Fixed bug 678239 which caused loss of namespace information in the client.
Mark Bucciarelli’s <email@example.com> has ported client support for WSDL from ZSI, as well as providing a mechanism for SOAPpy servers to provide WSDL on properly structured .GET requests.
Added ThreadingSOAPServer which inherits from ThreadingTCPServer server so that multiple clients will be automatically multiplexed.
CHANGES SINCE VERSION 0.9.9-pre5
Major Change: The huge file SOAPpy/SOAP.py (4,122 lines, 131K) has been split into 10 separate files:
Client.py NS.py SOAPBuilder.py Utilities.py Config.py Parser.py Server.py Errors.py SOAP.py Types.py
This should ease navigation and maintenance.
A new CVS module ‘wstools’ was created to hold code which is used by both ZSI and SOAPpy. While this module is stored separately in CVS, it will be distributed as an integral part of both ZSI and SOAPpy, and will be included as an ‘internal’ module by both. In the SOAPpy source, it lives in the directory SOAPpy/wstools.
The files XMLname.py, ieee754.py, have been moved into SOAPpy/wstools.
Added TODO file
Fix bug in getNS that caused loss of namespace by using better pattern matching to find the namespace in the SOAP message. Fixes bug 678239
Added Mark Bucciarelli’s <firstname.lastname@example.org> patch to provide wsdl code on properly structured .GET requests to the server.
Added client support for WSDL, ported from ZSI by Mark Bucciarelli <email@example.com>
Added ThreadingSOAPServer which inherits from ThreadingTCPServer server so that muliple clients will be automatically multiplexed.
Removed some files from /test for services that no longer exist.
IEEE 754 floating point specials (Inf, -Inf, NaN) should now be properly and consistently handled on all platforms.
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.*
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.
Modified structure to allow installation using Python distutils (i.e. setup.py). Access to the SOAPpy library now requires: from SOAPpy import SOAP
I (Gregory R. Warnes) 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.
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 xml tag id as the parameter name. Outgoing SOAP method calls now always generate names in this way–whether or not specialArgs is enabled–instead of using the pattern v#####.
See the file README.MethodParameterNaming for more details.
Added noroot parameter to the SOAPBuilder and SOAPProxy objects in order to provide compatibility with an older version of EasySOAP (v0.2) that balked if the SOAP-ENC:root parameter was included.(Brad Knotwell)
Added support for namespace-rewriting (used by Apache v2.x SOAP server for error conditions as well as stateful communication) (Christopher Blunck)
Added string <-> str conversion for array types (Python 2.2+) (Christopher Blunck)
Added convenience method (invoke) to SOAPProxy that calls __call (not sure if it is necessary - feel free to remove if you want) (Christopher Blunck)
Python ‘float’ are equivalent to SOAP ‘double’. Modified dump_float and dump_list to use SOAP type string ‘double’ appropriately. (Gregory R. Warnes)
Add basic authentication (Brad Knotwell)
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 (Gregory R. Warnes)
Added XMLnam.py which provides toXMLname() and fromXMLname() for properly encoding xml tag names per the SOAP 2.1 (draft) specification. (Gregory R. Warnes)
Added calls to toXMLname() and fromXMLname() so that tags names are properly encoded. This resolves bug [ 548785 ] ‘Error passing dict keys containing space.’ (Gregory R. Warnes)
Added code to cgi encode contents of tags when they are not a recognized type. Fixes bug [ 549551 ] ‘Error when passing non-standard types’. (Gregory R. Warnes)
Added __init__.py, so that SOAPpy can be used like a standard python module. (Gregory R. Warnes)