On 09/17/2012 09:52 PM, Burak Arslan wrote:
hello,
On 17/09/12 17:01, Florian Demmer wrote:
hi!
is there an option to not have <wsdl:documentation> tags with the
<wsdl:operations> even if there are docstrings in the @rpc decorated
functions?
not in spyne. but you can remove them with some xpath magic in a wsdl
event.
burak
so this works now:
def _remove_docstrings(ctx):
#log.debug('_remove_docstrings')
from lxml import etree
root = etree.XML(ctx.transport.wsdl)
for element in root.findall('.//{%s}documentation' % NS_WSDL):
element.getparent().remove(element)
ctx.transport.wsdl = etree.tostring(root, xml_declaration=True,
encoding="UTF-8")
app.event_manager.add_listener('wsdl', _remove_docstrings)
but it requires reading the xml string into an etree, changing the
etree, writing xml again to the context.
i tried using the 'document_built' event of the wsdl11 interface, but
there for some reason i did not get the complete wsdl, but only the "xs"
parts.
is there another event i missed, where i get the etree before it is made
tostring?
thanks,
Florian
_______________________________________________
Soap mailing list
[email protected]
http://mail.python.org/mailman/listinfo/soap