REST-to-REST Service Routing
- Home
- Neuron ESB
- Development
- Samples and Walkthroughs
- Services (Samples)
- REST Samples
- REST-to-REST Service Routing
Overview
REST stands for Representational State Transfer and is an architectural style for designing networked applications. It is commonly used in conjunction with the HTTP protocol to provide RESTful services. Neuron provides a means to route messages to and from RESTful services allowing communication between them and many other services and applications.
This sample demonstrates how to route RESTful services through Neuron. The sample first demonstrates a Windows Communication Foundation (WCF) client directly calling a WCF service utilizing the WebHttp binding. The second part of the sample demonstrates routing the service call through Neuron.
Running the Sample
Open the Sample
To open this sample, see the topic Using the Neuron Samples and select the REST Client to REST Service sample.
Setup Instructions
Before running this sample, follow these instructions:
- In the Visual Studio project that opens, build the entire solution.
Run Instructions
Direct Service Call
- In Visual Studio, press F5 to start both the CustomerRESTClient and CustomerRESTService projects.
- In the CustomerRESTClient console window, press Enter to start sending messages to Neuron.
- As the sample runs, the client sends a message to the service and displays the response.
- When the client completes, press <ENTER> in both the client and service consoles to close the applications.
Routed Service Call
- In the RESTtoREST Visual Studio project, open the file Program.cs from the CustomerRESTClient project.
- Modify the code to comment the URL for a direct service call and uncomment the URL for the routed service call. The final code should look like this:
// Use this URL for a direct service call //string baseurl = "https://localhost:8011/Customer"; // Use this URL for a routed service call string baseurl = "https://localhost:8001/Customer";
- Build the solution.
- In Visual Studio, press F5 to start both the CustomerRESTClient and CustomerRESTService projects.
- In the CustomerRESTClient console window, press Enter to start sending messages to Neuron.
- As the sample runs, the client sends a message to Neuron and displays the response.
- When the client completes, press <ENTER> in both the client and service consoles to close the applications.