Fuse 6 is no longer supported
As of February 2025, Red Hat Fuse 6 is no longer supported. If you are using Fuse 6, please upgrade to Red Hat build of Apache Camel.此内容没有您所选择的语言版本。
140.6. XML Serialization for RFC
Overview 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
SAP request and response objects support an XML serialization format which enable these objects to be serialized to and from an XML document.
XML namespace 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
Each RFC in a repository defines a specific XML name space for the elements which compose the serialized forms of its Request and Response objects. The form of this namespace URL is as follows:
http://sap.fusesource.org/rfc/<Repository Name>/<RFC Name>
http://sap.fusesource.org/rfc/<Repository Name>/<RFC Name>
RFC namespace URLs have a common
http://sap.fusesource.org/rfc
prefix followed by the name of the repository in which the RFC’s metadata is defined. The final component in the URL is the name of the RFC itself.
Request and response XML documents 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
An SAP request object will be serialized into an XML document with the root element of that document named Request and scoped by the namespace of the request’s RFC.
<?xml version="1.0" encoding="ASCII"?> <BOOK_FLIGHT:Request xmlns:BOOK_FLIGHT="http://sap.fusesource.org/rfc/nplServer/BOOK_FLIGHT"> ... </BOOK_FLIGHT:Request>
<?xml version="1.0" encoding="ASCII"?>
<BOOK_FLIGHT:Request
xmlns:BOOK_FLIGHT="http://sap.fusesource.org/rfc/nplServer/BOOK_FLIGHT">
...
</BOOK_FLIGHT:Request>
An SAP response object will be serialized into an XML document with the root element of that document named Response and scoped by the namespace of the response’s RFC.
<?xml version="1.0" encoding="ASCII"?> <BOOK_FLIGHT:Response xmlns:BOOK_FLIGHT="http://sap.fusesource.org/rfc/nplServer/BOOK_FLIGHT"> ... </BOOK_FLIGHT:Response>
<?xml version="1.0" encoding="ASCII"?>
<BOOK_FLIGHT:Response
xmlns:BOOK_FLIGHT="http://sap.fusesource.org/rfc/nplServer/BOOK_FLIGHT">
...
</BOOK_FLIGHT:Response>
Structure fields 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
Structure fields in parameter lists or nested structures are serialized as elements. The element name of the serialized structure corresponds to the field name of the structure within the enclosing parameter list, structure or table row entry it resides.
<BOOK_FLIGHT:FLTINFO xmlns:BOOK_FLIGHT="http://sap.fusesource.org/rfc/nplServer/BOOK_FLIGHT"> ... </BOOK_FLIGHT:FLTINFO>
<BOOK_FLIGHT:FLTINFO
xmlns:BOOK_FLIGHT="http://sap.fusesource.org/rfc/nplServer/BOOK_FLIGHT">
...
</BOOK_FLIGHT:FLTINFO>
Note that the type name of the structure element in the RFC namespace will correspond to the name of the record meta data object which defines the structure, as in the following example:
This distinction will be important when specifying a JAXB bean to marshal and unmarshal the structure as will be seen in Section 140.10, “Example 3: Handling Requests from SAP”.
Table fields 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
Table fields in parameter lists or nested structures are serialized as elements. The element name of the serialized structure will correspond to the field name of the table within the enclosing parameter list, structure, or table row entry it resides. The table element will contain a series of row elements to hold the serialized values of the table's row entries.
Note that the type name of the table element in the RFC namespace will correspond to the name of the record meta data object which defines the row structure of the table suffixed by
_TABLE
. The type name of the table row element in the RFC name corresponds to the name of the record meta data object which defines the row structure of the table, as in the following example:
This distinction will be important when specifying a JAXB bean to marshal and unmarshal the structure as will be seen in Section 140.10, “Example 3: Handling Requests from SAP”.
Elementary fields 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
Elementary fields in parameter lists or nested structures are serialized as attributes on the element of the enclosing parameter list or structure. The attribute name of the serialized field corresponds to the field name of the field within the enclosing parameter list, structure, or table row entry it resides, as in the following example:
Date and time formats 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
Date and Time fields are serialized into attribute values using the following format:
yyyy-MM-dd'T'HH:mm:ss.SSSZ
yyyy-MM-dd'T'HH:mm:ss.SSSZ
Date fields will be serialized with only the year, month, day and timezone components set:
DEPDATE="2014-03-19T00:00:00.000-0400"
DEPDATE="2014-03-19T00:00:00.000-0400"
Time fields will be serialized with only the hour, minute, second, millisecond and timezone components set:
DEPTIME="1970-01-01T16:00:00.000-0500"
DEPTIME="1970-01-01T16:00:00.000-0500"