이 콘텐츠는 선택한 언어로 제공되지 않습니다.

102.8. XML Serialization


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>
Copy to Clipboard Toggle word wrap
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>
Copy to Clipboard Toggle word wrap
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>
Copy to Clipboard Toggle word wrap

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>
Copy to Clipboard Toggle word wrap
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:
<xs:schema
     targetNamespace="http://sap.fusesource.org/rfc/nplServer/BOOK_FLIGHT">
     xmlns:xs="http://www.w3.org/2001/XMLSchema">
    ... 
    <xs:complexType name="FLTINFO_STRUCTURE”>
    ...
    </xs:complexType>
    ... 
</xs:schema>
Copy to Clipboard Toggle word wrap
This distinction will be important when specifying a JAXB bean to marshal and unmarshal the structure as will be seen in Section 102.11, “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.
<BOOK_FLIGHT:CONNINFO
     xmlns:BOOK_FLIGHT="http://sap.fusesource.org/rfc/nplServer/BOOK_FLIGHT">
    <row ... > ... </row>
    ... 
    <row ... > ... </row>
</BOOK_FLIGHT:CONNINFO>
Copy to Clipboard Toggle word wrap
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:
<xs:schema
     targetNamespace="http://sap.fusesource.org/rfc/nplServer/BOOK_FLIGHT">
     xmlns:xs="http://www.w3.org/2001/XMLSchema">
    ... 
    <xs:complextType name="CONNECTION_INFO_STRUCTURE_TABLE”>
        <xs:sequence>
            <xs:element 
                name="row”
                minOccures="0” 
                maxOccurs="unbounded” 
                type="CONNECTION_INFO_STRUCTURE”/>
            ...
            <xs:sequence>
        </xs:sequence>
    </xs:complexType>

    <xs:complextType name="CONNECTION_INFO_STRUCTURE”>
            ...
    </xs:complexType>
    ... 
</xs:schema>
Copy to Clipboard Toggle word wrap
This distinction will be important when specifying a JAXB bean to marshal and unmarshal the structure as will be seen in Section 102.11, “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:
<?xml version="1.0" encoding="ASCII"?>
<BOOK_FLIGHT:Request
     xmlns:BOOK_FLIGHT="http://sap.fusesource.org/rfc/nplServer/BOOK_FLIGHT"
     CUSTNAME="James Legrand" 
    PASSFORM="Mr" 
    PASSNAME="Travelin Joe" 
    PASSBIRTH="1990-03-17T00:00:00.000-0500" 
    FLIGHTDATE="2014-03-19T00:00:00.000-0400" 
    TRAVELAGENCYNUMBER="00000110" 
    DESTINATION_FROM="SFO" 
    DESTINATION_TO="FRA"/>
Copy to Clipboard Toggle word wrap

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
Copy to Clipboard Toggle word wrap
Date fields will be serialized with only the year, month, day and timezone components set:
DEPDATE="2014-03-19T00:00:00.000-0400"
Copy to Clipboard Toggle word wrap
Time fields will be serialized with only the hour, minute, second, millisecond and timezone components set:
DEPTIME="1970-01-01T16:00:00.000-0500"
Copy to Clipboard Toggle word wrap
맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2025 Red Hat