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.이 콘텐츠는 선택한 언어로 제공되지 않습니다.
127.7. XML Serialization for IDoc
Overview 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
An IDoc message body can be serialized into an XML string format, with the help of a built-in type converter.
XML namespace 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
Each serialized IDoc is associated with an XML namespace, which has the following general format:
http://sap.fusesource.org/idoc/repositoryName/idocType/idocTypeExtension/systemRelease/applicationRelease
http://sap.fusesource.org/idoc/repositoryName/idocType/idocTypeExtension/systemRelease/applicationRelease
Both the
repositoryName
(name of the remote SAP meta-data repository) and the idocType
(IDoc document type) are mandatory, but the other components of the namespace can be left blank. For example, you could have an XML namespace like the following:
http://sap.fusesource.org/idoc/MY_REPO/FLCUSTOMER_CREATEFROMDATA01///
http://sap.fusesource.org/idoc/MY_REPO/FLCUSTOMER_CREATEFROMDATA01///
Built-in type converter 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
The Camel SAP component has a built-in type converter, which is capable of converting a
Document
object or a DocumentList
object to and from a String
type.
For example, to serialize a
Document
object to an XML string, you can simply add the following line to a route in XML DSL:
<convertBodyTo type="java.lang.String"/>
<convertBodyTo type="java.lang.String"/>
You can also use this approach to a serialized XML message into a
Document
object. For example, given that the current message body is a serialized XML string, you can convert it back into a Document
object by adding the following line to a route in XML DSL:
<convertBodyTo type="org.fusesource.camel.component.sap.model.idoc.Document"/>
<convertBodyTo type="org.fusesource.camel.component.sap.model.idoc.Document"/>
Sample IDoc message body in XML format 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
When you convert an IDoc message to a
String
, it is serialized into an XML document, where the root element is either idoc:Document
(for a single document) or idoc:DocumentList
(for a list of documents). Example 127.2, “IDoc Message Body in XML” shows a single IDoc document that has been serialized to an idoc:Document
element.
Example 127.2. IDoc Message Body in XML