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

Daniele Bortoluzzi daniele at elkos.it
Mon Aug 10 17:54:29 UTC 2015


On 10 August 2015 at 19:13, Burak Arslan <burak.arslan at arskom.com.tr> wrote:

>
> On 08/10/15 19:47, Daniele Bortoluzzi wrote:
> [...]
>

First of all, sorry for top-posting in the previous message :(


> sorry, that's not what I meant.
>
> In the document that is produced by "their" client, is there an
> xmlns="something" (not xmlns:ns1="Something", only xmlns="Something")
>

No, there isn't. the SOAP-ENV tag of "their" message is the same as "mine".

>
> Spyne does not like undefined namespaces. I think the reason for it was my
> not being able to figure out the schema document to validate an undefined
> namespace.
>

Their message seems well-formed, the question is: if I define a service in
Spyne, must every tag of the input message contain a namespace? Once I have
set up a namespace in the parent element, why does every child contain the
same NS?
Setting an empty __namespace__ or sub_ns attribute has no effect because
you also check for zero-length strings.

>
> if you got issues with namespaces, try soft validation.
>

This could be the fastest solution.


> if nothing works, you can set up a before_deserialize event on your input
> protocol to use string methods to replace unwanted namespace prefixes. yes,
> it's disgusting but it'll work :)
>

Well, I have the opposite problem: the Spyne WS expects a namespace in
every tag so I should *add* a namespace wherever "their" message lacks it.
Yeah, mangling the input message is disgusting :)

Thank you for your time and being so helpful.

Cheers,

Daniele
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spyne.io/archives/people/attachments/20150810/25845214/attachment.html>


More information about the people mailing list