[Soap-Python] status update on soaplib

Burak Arslan burak.arslan at arskom.com.tr
Fri Jul 9 13:19:39 CEST 2010


hi there,

first, with github's introduction of organizations i moved my the repo
to: http://github.com/arskom/soaplib

as of soaplib-0.9dev5, xml schema validation using lxml.etree.XMLSchema
object seems to be working.

for the uninitiated, wsdl's type defintions adopt W3C's XML Schema
standard (http://duckduckgo.com/?q=XML%20Schema%20%28W3C%29). libxml2,
and thus lxml come with XML Schema validation support. so now, you can
define all sorts of constraints like regular expressions, min/maxOccurs,
min/max string length, enumerations, extensions etc. which actually do
get enforced, for free. be warned though, that the additional strictness
will certainly break your app, if the api changes were not enough :)

you need to inherit from ValidatingWsgiSoapApp for validation to work.

=============

implementation quirks:

libxml2's schema implementation is not complete. see
http://xmlsoft.org/. soaplib currently only supports a fraction of the
standard -- actually the above-cited types of constraints are a pretty
good summary.

creation the XMLSchema object is a horrible hack. as i could not get
proper feedback on this thread:

http://codespeak.net/pipermail/lxml-dev/2010-July/005539.html

so what currently happens is that the schema node for every namespace is
serialized to own files in a temporary directory, re-parsed to create
the XMLSchema object and deleted. this happens on the first connection
request, every time after the server is restarted.

Q: why not do it on restart, without waiting the first connection?
A: because we need the url string to generate the wsdl.

you have a better idea about any point above, chime in.

i also would be glad to hear about this new feature's performance
implications.

the wsdl is validated as it's generated as well, so you can't make
incorrect declarations.

=============

oh and the error messages are ugly.

so anyway, after forward-porting a few patches from the old soaplib, i
plan to release a first 0.9-alpha.

btw, jamie, i guess i should be doing the next pypi release, for both
the 0.8 and 0.9 branches, when it's time. could you please pass me the
relevant information, if there are no objections to this?

best regards,
burak





More information about the Soap mailing list