[spyne] defining a service without expecting namespace in every tag

Daniele Bortoluzzi daniele at elkos.it
Mon Aug 10 16:12:19 UTC 2015

Dear Spyne users,

I am setting up a SOAP service implementing a predefined WSDL. I cannot
tell Spyne not to expect a namespace in every tag of the input XML.

This is what "their" client sends with their WSDL:

<SOAP-ENV:Envelope xmlns:ns1="myNameSpace" PLUS_LOTS_OF_ATTRIBUTES>

and this is what my test client would send with the Spyne-generated WSDL:

<SOAP-ENV:Envelope xmlns:ns1="myNameSpace" PLUS_LOTS_OF_ATTRIBUTES>

"ns1" is everywhere and I don't know how to get rid of it.

Moreover, if I don't set a __namespace__ attribute on my custom
ComplexModel input objects, the WSDL shows the module name (e.g. the file
in which I defined the custom objects) as the namespace.

I am using the @rpc decorator as follows:

import spyne.const
spyne.const.REQUEST_SUFFIX = 'Request'

@rpc(NotifyReq, _returns=NotifyResponseMessage)
def Notify(ctx, n_req):
     return ctrl.read_notify_response(n_req)

these are the models involved:

DEFAULT_NS = "myNameSpace"

class StatusNotification(ComplexModel):
    __namespace__ = DEFAULT_NS
    subtag1 = Unicode
    subtag2 = Unicode

    class Attributes(ComplexModel.Attributes):
        max_occurs = 1
        min_occurs = 1

class NotifyReq(ComplexModel):
    __namespace__ = DEFAULT_NS
    mytag1 = Unicode
    notifications = Array(StatusNotification,

What am I missing?

Thank you in advance
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spyne.io/archives/people/attachments/20150810/ba18f312/attachment.html>

More information about the people mailing list