def add_prefix(self, prefix, uri):
root = self.wsdl.root<EOL>mapped = root.resolvePrefix(prefix, None)<EOL>if mapped is None:<EOL><INDENT>root.addPrefix(prefix, uri)<EOL>return<EOL><DEDENT>if mapped[<NUM_LIT:1>] != uri:<EOL><INDENT>raise Exception('<STR_LIT>' % (prefix, mapped))<EOL><DEDENT>
Add I{static} mapping of an XML namespace prefix to a namespace.
This is useful for cases when a wsdl and referenced schemas make heavy
use of namespaces and those namespaces are subject to changed.
@param prefix: An XML namespace prefix.
@type prefix: str
@param uri: An XML namespace URI.
@type uri: str
@raise Exception: when prefix is already mapped.