views:

45

answers:

2

I am working on an API using SOAP and WSDL. The WSDL expects integers to come through. I am fairly new to ALL of this, and constructing XML in Python. I have chosen to use minidom to create my SOAP message. So using minidom, to get a value into a node I found I have to do this:

 weight_node = xml_file.createElement("web:Weight")
 weight_contents = xml_file.createTextNode(weight)
 weight_node.appendChild(weight_contents)

So say weight needs to go in as an integer and IS an integer. The function is 'createTextNode' does this mean its going to be text, or what I put in there has to be text? Again I am fairly new to all of this. So if what I have explained seems way off base, please speak up.

A: 

OK so the answer to this is you can only send strings into createTextNode...so then how do you create an INTEGER node wtf?

KacieHouser
A: 

OK I feel stupid, xml is a string! WSDL just makes sure that the value in the node can be converted to an integer.

KacieHouser