On 09/19/2012 12:31 AM, Burak Arslan wrote:
On 18/09/12 12:38, Florian Demmer wrote:

so this works now:

    <snip>

but it requires reading the xml string into an etree, changing the etree, writing xml again to the context.


Hi Florian,

I will fix this in the next Spyne release, I was not aware that the document_built events were not working.

In the mean time you can use this hack:

app = Application(...)
wsgi_app = WsgiApplication(app)
wsdl = Wsdl11(app.interface)
wsdl.build_interface_document("https://example.com/some_app/?wsdl";)
for element in wsdl.root_elt.findall('.//{%s}documentation' % NS_WSDL):
     element.getparent().remove(element)wsdl.root_elt.xpath()
wsgi_app._wsdl = wsdl.get_interface_document()

Does it work?

nope does not... added a linebreak after the remove(), the xpath was an oversight, right?
maybe it's because my wsgi_app is actually the djangoapp?

   wsdl = Wsdl11(app.interface)
   wsdl.build_interface_document("https://example.com/some_app/?wsdl";)
   for element in wsdl.root_elt.findall('.//{%s}documentation' % NS_WSDL):
        element.getparent().remove(element)
        #wsdl.root_elt.xpath()
   wsgi_app._wsdl = wsdl.get_interface_document()

but anyway!...
... i do not expect too much load on the wsdl and i think i can live with the read-xml/etree/write-xml with the "wsdl" callback. can improve with a later spyne release.

thanks!



_______________________________________________
Soap mailing list
[email protected]
http://mail.python.org/mailman/listinfo/soap

Reply via email to