
XML namespaces are important for exchanging messages.
Message instances must normally be assigned to a namespace. In the ES Builder, specify this XML namespace for (fault) message types. In the default setting, it is the repository namespace in which the (fault) message type was created that is transferred. In the following instance, it is recommended that the XML namespace is different to the repository namespace:
Two applications that communicate are usually located in different software component versions, which are not necessarily shipped to customers. To ensure that the customer does not receive incomplete service interface definitions, the ES Builder only permits references from service interface operations to (fault) message types in the same software component version or a sub-software component version. Both applications often want to use the same message types for communication. Since references are not possible, one of the applications can instead copy a message type from the other application to its repository namespace (preferably including all dependent objects, see also: Copying Objects ). If the application were to use its repository namespace as the XML namespace for the message type and its copy, this would be the only difference in the message instance and would require a mapping.
The XML namespace therefore enables two applications to agree on a namespace for a message. Proxy generation applies the XML namespace and proxy runtime uses it in the message instance:
An XML Namespace for Message Types
<ns1:SalesOrder xmlns:ns1="http://sap.com/CRM">
<OrderHeader> ... </OrderHeader> <OrderItems> ... </OrderItems></SalesOrder>
An XML Namespace for Data Type Enhancements
In this imaginary example, the suffix Type is added to the data type name to help distinguish it from the root elements Address and OrderHeader. Suffixes do not have to be used otherwise.
CUST_APOCUST_CRM
<ns1:SalesOrder xmlns:ns1="http://sap.com/CRM" xmlns:ns2="http://customer.com/CRM/AddrExtension">
<OrderHeader> <ShipTo> <PartyId>1234</PartyId> <Address ns2:Airport="SFAirport" > <Name>Johnson</Name> <Street>Lombard Street 10</Street> <City>SanFrancisco</City> <Country>US</Country> <ns2:State>California</cus:State> </Address> </ShipTo> </OrderHeader>
<OrderItems> ...</OrderItems>
</ns1:SalesOrder>