Skip to main content
Skip table of contents

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: convertXML: Convert XML

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. UTF-8 (default))

Status values

1The operation was executed successfully.
0

The operation was executed successfully, but without any result.

-1The operation failed due to a technical error.

Input

The adapter input can be structured as follows:

XML
<?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
<?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
<?xml version="1.0" encoding="UTF-8"?>
<Hallo><Welt/></Hallo>

Result of the ReST response

XML
<?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.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.