Fred,
Great questions.
pub.xml:documentToXMLString is used to create an XML string representation of an IData (document type). It will use whatever you specify in the nsdecls, but may not generate useful XML if you don’t match a prefix with an entry in the nsdecls.
For example, if your input document contained an element called foo:myVar where foo was associated with the namespace http://myNamespace, but you set your nsdecls to define bar instead, you would end up with the following xmlstring:
<foo:myDoc
xmlns:bar=“http://myNamespace”>
foo:myVarString</foo:myVar>
</foo:myDoc>
This may be technically well-formed, but would be nondeterminsitic on its own because you haven’t defined what namespace is to be associated with the “foo” prefix.
pub.xml:queryXMLNode requires that the prefixes match if you want to be able to use XQL queries that specify a prefix of your choosing that will work regardless of what prefix the client sends. The XQL query “/*/nodeName()” works because the “*” is a wildcard meaning give me the nodeName of the root element regardless of how it is named.
pub.xml:nodeToDocument will name the resulting “document” based on whether it finds a match on the namespace. If the namespace matches it will use the prefix associated with that namespace in nsdecls. If not it will use the prefix that was supplied in the orignal node. Again, this is handy since you don’t know what prefix the sender will use and you can always create a document with a name you expect by correctly specifying the namespace definition.
BTW, the soap spec requires that the contents of the soap body be namespace qualified. While you can turn validation for this off in IS, you will reduce the interoperability of your web services.
HTH,
Mark
#API-Management#webMethods#soa