Software AG Products 10.7 | Integrating On-Premises and Cloud Applications | Service Development | Working with Variables | Using XML Namespaces and Namespace Prefixes with Variables
 
Using XML Namespaces and Namespace Prefixes with Variables
 
Guidelines for Using XML Namespaces and Prefixes with Web Service Descriptors
Assigning XML Namespaces and Prefixes to Variables
You can assign an XML namespace and prefix to a variable by specifying a URI for the XML namespace property and by using the following format for the variable name:
prefix:variableName
This creates a QName for the variable in which portions of the variable name are used as the prefix and local name and the value of the XML namespace property is the namespace name. For example, suppose that a variable is named eg:account and the XML namespace property is set to http://www.example.com. The prefix is eg, the localname is account and the namespace name is http://www.example.com.
When generating XML Schema definitions and WSDL documents, Integration Server uses the value of the XML Namespace property along with the variable name (the prefix and local name) to create a qualified name (QName) for the variable.
Integration Server also uses namespace prefixes assigned to variables in an IS document type when converting an XML document or XML node to a document (IData object). Integration Server obtains the namespace prefix to be used in the resulting document (IData) from the variable name in the document type rather than relying on the prefix present in the actual XML node. For example, suppose that Integration Server converts an XML node to a document (IData) using a document type to specify the structure to be imposed on the resulting document (IData). The document type contains a field named eg:account for which the XML Namespace property is set to www.example.com. The XML node contains an element named otherPrefix:account in which otherPrefix is defined to represent the namespace http://www.example.com. The resulting document (IData) contains a field named eg:account based on the document type field instead of otherPrefix:account as it appears in the original XML node.
Note:Integration Server automatically assigns an XML namespace to a variable when it creates a provider web service descriptor WSDL or a consumer web service descriptor from an existing WSDL. Integration Server also assigns an XML namespace from a schema when it creates a document type from an existing XML schema definition.