[Tutor] Question regarding xml.dom.minidom: How do you send an unsignedByte in an wsdl request

Garry Bettle garry.bettle at gmail.com
Fri Jul 22 20:18:13 CEST 2011


Howdy all,

Hope this message finds everyone well - roll on the weekend!

I'm trying some calls to an wsdl API I've subscribed to.

But I'm struggling to know what they want when sending an unsignedByte in a
request.

I'm using xml.dom.minidom so to start with I have:
from xml.dom.minidom import Document, parseString
import httplib, urlparse

And later on I create a doc with:
doc=Document()

And I have a using a little helper to add a text element:
def add_text_element(doc, parent, name, value):
    element=doc.createElement(name)
    element.appendChild(doc.createTextNode(str(value)))
    parent.appendChild(element)

Should I have a separate class for an unsignedByte? i.e. def
add_byte_element

What should it look like?

This is what their API helpdesk have said:

"In this instance, the PriceFormat is defined as an unsignedByte.



     *<xs:complexType name="GetOddsLadderRequest">*

*<xs:attribute name="PriceFormat" type="xs:unsignedByte" /> *

*</xs:complexType>*"

Many thanks!

Cheers,

Garry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20110722/4689fcea/attachment.html>


More information about the Tutor mailing list