Skip to content
This repository has been archived by the owner on Oct 10, 2024. It is now read-only.

Add sample for message content transformation #40

Merged
merged 3 commits into from
Jun 6, 2019

Conversation

keerthu
Copy link
Contributor

@keerthu keerthu commented Jun 6, 2019

@@ -0,0 +1,18 @@
# Log file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we don't need this file. We can add whatever is missing into the main gitignore file

# transforming-message-content
# Message Transformation

This guide demonstrates how to transform a request message payload to a different format expected by the back-end service.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is a continuation of an integration tutorial can we rephrase and update sections thinking that a user is going through this example in order?

//Define endpoint for the backen service.
http:Client hospitalEP = new("http://localhost:9090");

//Constants for request paths.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
//Constants for request paths.
// Constants for request paths.

import ballerina/http;
import ballerina/log;

//Define endpoint for the backen service.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
//Define endpoint for the backen service.
// Define endpoint for the backen service.

const CLEMENCY_EP_PATH = "/clemency/categories/";
const PINE_VALLEY_EP_PATH = "/pinevalley/categories/";

//Constant for error code.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
//Constant for error code.
// Constant for error code.

path: "/categories/{category}/reserve"
}
resource function makeReservation(http:Caller caller, http:Request request, string category) {
//Extract payload from the request.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
//Extract payload from the request.
// Extract payload from the request.

}
}

//Function to create the error response.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
//Function to create the error response.
// Function to create the error response.

"appointment_date": "2017-04-02"
}
```
However, the format of the message required by the backend service as follows:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
However, the format of the message required by the backend service as follows:
However, the format of the message required by the backend service is as follows:

@Asitha Asitha merged commit 05a2f88 into wso2-attic:master Jun 6, 2019
Asitha pushed a commit to Asitha/ballerina-integrator that referenced this pull request Jul 1, 2019
Asitha pushed a commit to Asitha/ballerina-integrator that referenced this pull request Jul 1, 2019
Fix README.md for observability changes
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants