0

I'm far from a SOAP/XML expert, or even close to be one. However, I have some common sense. I am integrating towards a SOAP service, wsdl located here: https://www1.uc.se/UCSoapWeb/services/ucOrders2?wsdl

I'm doing this all in Python, and using the jurko suds fork. When creating the calls they fail. This tag was the problematic tag. Suds generated this:

<ns1:template id="KH9"/>

But to get it to work I had to user a MessagePlugin plugin that I wrote my self to marshall the XML before sending to the endpoint. This is what it required:

<ns1:template ns1:id="KH9"/>

First, shouldn't I trust suds? And I do... Second. Why do I need to define the namespace for the attribute in ns:template tag, isn't the namespace inherited from the tag namespace?

This answer supports me, but doesn't include the attribute example I'm looking at: https://stackoverflow.com/a/2193381/788022

Am I wrong? Is suds wrong? Or is the SOAP service that I'm integrating towards wrong? Or are we all wrong? :)

2 Answers 2

1

The fix you did is required and correct. It is because of the attributeFormDefault declaration:

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
     ... 
     attributeFormDefault="qualified"* 
     ...
>

The effect of this declaration is that all local attributes defined by the schema will belong to the target name space of the schema, and must have a name space prefix. The default value of the attributeFormDefault is unqualified, which means that local attribute declarations will not belong to any name space.

Unprefixed attributes always belong to the empty name space, i.e. they have no name space. You can read all the gory details here.

Perhaps some doubt of "suds" is appropriate (I know nothing about it, btw).

Sign up to request clarification or add additional context in comments.

Comments

0

Judjing by http://www.w3.org/TR/1999/REC-xml-names-19990114/#Philosophy you should indeed use

<ns1:template ns1:id="KH9"/>

as just id="..." does not inherit any namespace.

Unfotunately, it seems like a problem/misuse of jurko-suds.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.