RESTful WEB SERVICE Mapping |
Web Services |
For published RESTful Web Services, you must map the PROIV task to an incoming HTTP/S request. A published RESTful Web Service executes the task, by matching the URL path and HTTP/S methods. The mapping is done using the path of the incoming URL (server and port) and the HTTP/S methods (GET, PUT, POST and DELETE). Additionally, partial matches can happen when a URL contains components that do not map to the exact name. For example, a mapping of ‘abc’ would match a URL of "abcdef" and equally "/abc123" and also "abc/def". You can select the required connector and set an authentication Challenge Response (Server issues a challenge and the Client sends a response) to connect to the gateway.
When an incoming RESTful Service Request has a match in its path and its method then the task for the Published RESTful Web Service is called to get the response.
HTTP Methods (GET, PUT, POST, DELETE)
The HTTP methods in the non-error path, returns a representation in XML or JSON and an HTTP response code of 200 (OK). In an error case, it most often returns a 404 (NOT FOUND) or 400 (BAD REQUEST).
GET
In general, the HTTP GET method request is used to read data. The resource identifiers in GET method are communicated with URL or Header parameters and do not have a request body.
PUT and POST
Use PUT when you can update a resource completely through a specific resource. For instance, if you know that an article resides at http://sample.org/article/1234, you can PUT a new resource representation of this article directly through a PUT on this URL.
If you do not know the actual resource location, for instance, when you add a new article, and do not have any idea to store it, you can POST it to an URL, and the server decides the actual URL. However, when you know the new resource location, you can use PUT again to update the existing item.
The PUT method requests that the enclosed entity be stored under the supplied Request-URL. If the Request-URL refers to an already existing resource, the enclosed entity SHOULD be considered as a modified version of the one residing on the origin server. If the Request-URL does not point to an existing resource, and that URL is capable of being defined as a new resource by the requesting user agent, the origin server can create the resource with that URL".
The POST method is used to request that the origin server accept the entity enclosed in the request as a new subordinate of the resource identified by the Request-URL in the Request-Line.
DELETE
DELETE is used to delete a resource identified by the information which is contained in the request.
PROIV supports the following ways to send the data or parameters through the RESTful Web Services Server.
Mime Type |
|
Delete |
Get |
Post |
Put |
Any |
Url Parameters |
header.parameters |
header.parameters |
header.parameters |
header.parameters |
|
Headers |
Put into the header object |
Put into the header object |
Put into the header object | Put into the header object |
Application/www form URL encoded |
Body Params |
N/A |
N/A |
Promoted to header.parameters |
Promoted to header.parameters |
|
JSON Body |
N/A |
N/A |
Put the JSON in the header.parameters. It is unlikely to be in a shape that makes any sense as URL encoded Name value pairs. |
Put the JSON in the header.parameters. It is unlikely to be in a shape that makes any sense as URL encoded Name value pairs. |
|
XML Body |
N/A |
N/A |
Put the JSON in the header.parameters. It is unlikely to be in a shape that makes any sense as URL encoded Name value pairs. |
Put the JSON in the header.parameters. It is unlikely to be in a shape that makes any sense as URL encoded Name value pairs. |
Application/JSON |
JSON Body |
N/A
|
N/A |
JSON decoded to create the body object. |
JSON decoded to create the body object. |
|
BodyParams |
N/A
|
N/A |
Put in the stringBody. | Put in the stringBody. |
|
Non JSON Body |
N/A
|
N/A |
Put in the stringBody. | Put in the stringBody. |
Application/xml |
XML Body |
N/A |
N/A |
XML converted to JSON and decoded to create the body object. |
XML converted to JSON and decoded to create the body object. |
|
Body Parameters |
N/A |
N/A |
Put in the stringBody. |
Put in the stringBody. |
|
Non XML Body |
N/A |
N/A |
Put in the stringBody. |
Put in the stringBody. |
Text/html |
Html Body |
N/A |
N/A |
Put in the stringBody. |
Put in the stringBody. |
|
Body Parameters |
N/A |
N/A |
Put in the stringBody. |
Put in the stringBody. |
Text/Plain |
Text Body |
N/A |
N/A |
Put in the stringBody. |
Put in the stringBody. |
|
Body Parameters |
N/A |
N/A |
Put in the stringBody. | Put in the stringBody. |
The contents of the body is added to request.stringBody in a raw string form in every case. |
Topic ID: 400033