Example Web Service that Accepts Parameters From URL

Document created by chris_stevens Employee on Oct 27, 2015Last modified by chris_stevens Employee on Mar 21, 2016
Version 3Show Document
  • View in full screen mode
You wish to make a REST Call that does not pass a payload, but accepts input parameters through the URL itself, such as: http://example/ws/REST/Weather/12345
Let's start by configuring a simple listener. This example won't go through the details of the actual HTTP connector, and is also assuming that you have your Shared Web Server Settings configured correctly.

 

Here's our process:

 

The Listener shape is configured as so:
0EM40000000bt95
*Notice there is None defined for the Input Type. This determines that no payload is necessary for this call.

 

Within the HTTP Client shape, the Weather API is being called which requires the zip code:
0EM40000000bt9F

 

Back in the process level, under Parameters for the HTTP Client shape, we're defining the zipToReplace as a Dynamic Process Property, called: param_Zip
0EM40000000bt9K
Naming is important here. param_[name], where [name] is equal to the URL parameter definition that will be specified within the Web Service Component.

 

Now, for the Web Service Component. Import the process and most of it should be configured for you, except for URL Path. You'll need to define that as such:

 

Deploy your listener, and then deploy your Web Service. Now, when you call your web service using: http://example/ws/REST/Weather/12345, 12345 will be passed to the HTTP Connector as the zip code, and the Weather response will be returned to the user.
5 people found this helpful

Attachments

    Outcomes