Back to Rest BC Echo, or Rest BC Echo Info
| At line 4 changed 1 line. |
| !!! Summary |
| !! Summary |
| This sample illustrates how to leverage RestBC in OpenESB to implement a simple Echo service. The Echo service simply returns the same input data by user using HTTP POST to the service. |
| At line 8 added 1 line. |
| !! How to Build the Sample Project |
| At line 8 changed 1 line. |
| !!! How to Build the Sample Project |
| * First we need to create a BPEL project using NetBeans IDE |
| At line 13 added 3 lines. |
| * Next, create a new WSDL document inside the BPEL project, choose Rest Inbound as the Binding to use in the wizard |
| At line 17 added 2 lines. |
| * Next, add a "POST" operation, and give the operation a name, such as "echo". Then click the "Edit Operation" button to edit more details about this operation |
| At line 20 added 2 lines. |
| * In the required "Path" textfield, put "/echo" as the URL path for the Echo service we wish to provision. For now, just leave everything else as default |
| At line 23 added 4 lines. |
| * After save changes to the WSDL document. Drag-n-drop the WSDL document into the BPEL editor on the left swim-lane. |
| * Add BPEL operators by drag-n-drop widgets from the right toolbox. We need "Receive", "Assign", and "Reply" operators in that order. |
| * Choose Partner-Links for the "Receive" and "Reply" operators. Then need to double-click the "Assign" operator to goto the BPEL mapper |
| At line 28 added 2 lines. |
| * In the mapper, simply map "EchoIn->part1" to "EchoOut->part1". This implements the simple Echo logic. |
| At line 31 added 4 lines. |
| * Save your changes |
| * Create a new Composite Application Project, and add the above created BPEL project to the Composite Application. |
| * Clean and build the Composition Application Project, then you should see something similar to the diagram show in the CASA Editor |
| At line 18 changed 1 line. |
| !!! Running the Sample |
| * Deploy the CompApp Project to GlassfishESB server. |
| * Your Echo project is now running and ready to be tested. |
| * The service URL is here: "http://localhost:9696/echo |
| At line 41 added 4 lines. |
| !! Running the Sample |
| * Use CURL tool to invoke the Echo service currently running |
| * First, let's try post a XML input data to the service, and see what happens |
| At line 46 added 2 lines. |
| * Next, switch the HTTP Headers to indicate that we are posting and accepting JSON data instead of XML data, and see what happens |
| At line 23 changed 1 line. |
| !!! Sample Project Zip |
| !! Sample Project Zip |
| * Attached is the reference project for the above steps |