X4 Streaming Support
This adapter takes an XML or XML fragment (well-nested) and creates a document from it that can be used as output for the ReST starter. Within this XML(-fragment) Stream
elements in the namespace x4feature:reststream
are searched for. These are included in the output, while all other parts are Base64 encoded. Thus XML documents can be generated as ReST output in which a stream is embedded Base64-encoded (e.g. a SOAP response if MTOM is not used).
Properties
Operation | Determines which operation the adapter executes Possible values: |
Parameters
Adapter | Main class of the adapter (do not change!) Possible values: de.softproject.integration.adapter.reststreamsupport.RestStreamSupportAdapter: Main class (default) |
inputEncoding | Character encoding of the input document Possible values: Any valid character encoding (e.g. |
Status values
1 | The operation was executed successfully. |
0 | The operation was executed successfully, but without any result. |
-1 | The operation failed due to a technical error. |
Input
The adapter input can be structured as follows:
<?xml version="1.0" encoding="UTF-8"?>
<RootElement>
<SomeElementBefore>Text</SomeElementBefore>
<ContainerForTheStream>
<Stream xmlns="x4feature:reststream" url="xstore://SomeProject/someData.xml" transcoding="base64-UTF-8"/>
</ContainerForTheStream>
<SomeElementAfter>More Text</SomeElementAfter>
</RootElement>
Output
The following XML structure is output by the adapter:
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Status code="200"/>
<Headers/>
<Content encoding="base64">PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPFJvb3RFbGVtZW50PgoJPFNv
bWVFbGVtZW50QmVmb3JlPlRleHQ8L1NvbWVFbGVtZW50QmVmb3JlPgoJPENvbnRhaW5lckZvclRo
ZVN0cmVhbT4=<Stream xmlns="x4feature:reststream" url="xstore://SomeProject/someData.xml" transcoding="base64-UTF-8"></Stream>
PC9Db250YWluZXJGb3JUaGVTdHJlYW0+Cgk8U29tZUVsZW1lbnRBZnRlcj5Nb3JlIFRleHQ8L1Nv
bWVFbGVtZW50QWZ0ZXI+CjwvUm9vdEVsZW1lbnQ+
</Content>
</Response>
This output can be returned to the ReST starter immediately, or can still be provided with appropriate headers.
Content of xstore://SomeProject/someData.xml
<?xml version="1.0" encoding="UTF-8"?>
<Hallo><Welt/></Hallo>
Result of the ReST response
<?xml version="1.0" encoding="UTF-8"?>
<RootElement>
<SomeElementBefore>Text</SomeElementBefore>
<ContainerForTheStream>PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxIYWxsbz48V2VsdC8+PC9IYWxsbz4=</ContainerForTheStream>
<SomeElementAfter>More Text</SomeElementAfter>
</RootElement>
Currently, there is no support when a stream is to be inserted into an attribute. In this case, the corresponding element and attribute must be assembled with Base64 strings in the Content
element.