The message format used by the SAP PI runtime engines is based on XML. Since a message can also have binary attachments in addition to the business data in XML, this documentation refers predominantly to messages in general and not specifically to XML messages .
XML (eXtensible Markup Language) allows the description of data in a form that is legible for people. An XML schema definition specifies which elements may be used, which attributes have these elements, and what structure they have. More than one instance (a document that matches an XML schema definition) can exist for each schema. The following example of an instance illustrates that the elements in a schema are ordered hierarchically:
<Address>200 S Wacker Drive Chicago IL 60606</Address>
<Item> Bass Guitar No.14 </Item>
These elements (for example, <Item> ) are also known as tags in HTML.
You can describe the structure of a schema by using an XML schema . As well as the description of the structure of an XML document (elements, attributes, hierarchy), this language allows you to define simple and complex data types. Note the following difference:
XML schema language provides a series of language constructs that you can use to describe an XML schema.
XML schema definition describes exactly one XML schema and is defined using the XML schema language.
More than one schema instance can exist for an XML schema. A schema instance is an XML document ; its structure and values are defined using a corresponding XML schema definition. The process whereby the system checks whether an XML document matches a schema definition is called validation .
The terms XML instance or schema instance are often used instead of XML document. Whereas the term XML document is normally used to refer to a document on a file system, the storage medium is less important in the other two terms.
The W3C recommendation for XML schema dated May 2, 2001 comprises three parts: HYPERLINK "http://www.w3.org/TR/xmlschema-0/" , HYPERLINK "http://www.w3.org/TR/xmlschema-1/" und HYPERLINK "http://www.w3.org/TR/xmlschema-2/" .
The message protocol used by SAP PI is based on the W3C note SOAP Messages with Attachments . For more information, see www.w3.org/TR/SOAP-attachments . The runtime engine of SAP PI expects a message that has the following structure:
The SOAP header of a message contains all the important information that the runtime engine of SAP PI requires to forward the message, while the Payload contains the actual business data (such as <PurchaseOrder> in the example above). You can also append an unlimited number of attachments to the message before it is sent. Attachments typically comprise non-XML data, for example, pictures, text documents, or binary files.
The information in the message header must have the correct format for the message to be processed by the runtime engine of SAP PI. The payload is not touched unless a mapping needs to be executed.
Using XML technology has, among others, the following advantages:
XML is the standard exchange format in the Internet. Before this standard was created, there were practically no open exchange formats, which made communication in heterogeneous system landscapes very difficult.
Further standards and tools now exist that make working with XML even easier, examples being XML Schema, XSLT and XPath. XSLT (eXtensible Stylesheet Language for Transformations), for example, enables you to define mappings for messages with different structures. XPath expressions enable conditions to be evaluated depending on values in the payload . Evaluations of this type are required for receiver determination in logical routing.
As a standardized format, XML also enables you to connect to external systems. Once data from an external system has been converted to XML using an adapter, then it is a simple step to convert the data to other XML formats for other receivers.
Web Services Protocol
Aside from the message protocol, SAP PI supports the Web services protocol. A Web service is a modularized, executable unit. It can be called in heterogeneous system landscapes and is not restricted to a single host system. Based on the given input parameters, output is determined by the system. This is then passed back to the caller subsequently. SOAP, WSDL, UDDI, and WS-RM are the core standard for all Web service approaches.