Cloud Application Integration (On-Premises) : Administering CloudStreams : Virtual Services : Creating a New Virtual Service (REST) : The "In Sequence" Step (REST) : The "Transform" Step (Inbound, REST)
The "Transform" Step (Inbound, REST)
The optional "Transform" step specifies how the request message is to be transformed before it is submitted to the native service.
As long as a consumer sends a REST request with the proper Content-Type (see HTTP Method/Content-Type Combinations) and as long as the HTTP method and endpoint URI are in the expected form, then CloudStreams can determine the correct service and operation; in this case, no message transformation is required. However, in some cases a virtual REST service might need to transform XML messages.
For example, you might need to accommodate differences between the message content that a consuming application is capable of submitting and the message content that a native service expects. For example, if the consuming application submits an order record using a slightly different structure than the structure expected by the native service, you can use the Transform step to transform the record submitted by the consuming application to the structure required by the Web service.
In this case, you would need to create two Transform steps:
*One in the "In Sequence" step, to transform the request messages into the format required by the native service, before CloudStreams sends the requests to the native services. To do this, you pass the message to an XSLT transformation file. (Additionally in this case, the transformation is required if the virtual service has a schema validation policy that validates the requests.)
*One in the "Out Sequence" step, to transform the native service's response messages into the format required by the consumer applications, before CloudStreams returns the responses to the consumer applications.
To add the "Transform" step (inbound, REST)
1. Open Software AG Designer and display the CloudStreams Development perspective by clicking Window > Open Perspective > Other > CloudStreams Development.
2. In the CloudStreams Governance view, expand your CloudStreams Governance project and click the virtual service name.
3. Right-click In Sequence and select Transform.
The Transform step is added under the Entry Step. You cannot change the order of the steps.
4. Click Transform and complete the following fields in the General page in the Properties view.
Option
Description
Name
You can optionally change the step name to any other name. There are no naming restrictions.
Type
(Read-only.) Transform.
XSLT File
The XSLT file to transform the request message before it is submitted to the native service. Click Browse to select a file from your file system and click Save.
The XSL file uploaded by the user should not contain the XML declaration in it (xml version="1.0" encoding="UTF-8"). This is because when the virtual service is deployed to CloudStreams, CloudStreams embeds the XSL file in the virtual service definition (VSD), and since the VSD itself is in XML format, there cannot be an XML declaration line in the middle of it. This can lead to unexpected deployment issues which can be avoided by making sure the XSL file does not contain the declaration line.
Note:  
If you make changes to the XSLT file in the future, you must re-deploy the virtual service.
5. To create an additional Transform step, right-click In Sequence and select Transform again.
6. To delete a Transform step, right-click Transform and click Delete Step.
Copyright © 2015- 2016 Software AG, Darmstadt, Germany.

Product LogoContact Support   |   Community   |   Feedback