InjectXmlDataIU

Group

Integration Units

Class Name

com.ebd.hub.datawizard.iu.InjectXmlDataIU

Function

This Integration Unit can be used to copy an XML element from an XML input file into a new destination file.

Description

Introduction: Integration Units.

The Integration Unit InjectXmlDataIU can be used to copy an XML element from an XML input file into a new destination file (template file). The Integration Unit always reads the backup file and can therefore also be used in a profile without mapping.

Parameter Description

Parameter Name

Allowed Values

Default Value

Description

Template file

Path to template file (mandatory).

XML element from source to include

Name of XML element from the source file to be copied and included in the template file.

Example

Suppose a profile that acts as a web service has received a request, which consists of a SOAP envelope with the payload in the body, as shown below. The encoding of the request has to match the profile encoding.

 
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:n2="http://tempuri.org/">
<soap:Body>
<n2:Request>
<n2:ID>ABC24</n2:ID>
<n2:Pos>
<n2:NR>7654</n2:NR>
</n2:Pos>
</n2:Request>
</soap:Body>
</soap:Envelope>

The root element of the payload data is <n2:Request>. To paste that payload into a template for the destination file, this template has to contain a placeholder @INJECT_PAYLOAD@. The class InjectXmlDataIU will now replace the placeholder with the payload data specified in the parameter XML element from source to include. To achieve that, use the following parameters.

Template file

<Path to template file>

XML element from source to include

n2:Request

If the XML element is repeated several times within the source data, the entire section between the first occurrence of the tag <n2:Request> and the last occurrence of the tag </n2:Request> will be inserted into the template.