Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "SMILA/Documentation/Processing/JSON REST API for BPEL pipelines"
< SMILA | Documentation
(New page: == Processing JSON REST API == SMILA now has a HTTP REST API that allows to invoke BPEL processing workflows. === Reference === * URL: <tt>http://<hostname>:8080/smila/pipeline/<workflo...) |
(→Example Session) |
||
Line 24: | Line 24: | ||
<code lang="text"> | <code lang="text"> | ||
− | + | $ resty http://localhost:8080 | |
http://localhost:8080* | http://localhost:8080* | ||
− | + | $ GET /smila/pipeline/SearchPipeline/process | |
{ | { | ||
"message" : "Cannot process an empty record." | "message" : "Cannot process an empty record." | ||
} | } | ||
− | + | $ POST /smila/pipeline/SearchPipeline/process | |
{ | { | ||
"message" : "Cannot process an empty record." | "message" : "Cannot process an empty record." | ||
} | } | ||
− | + | $ | |
</code> | </code> |
Revision as of 06:28, 17 May 2011
Processing JSON REST API
SMILA now has a HTTP REST API that allows to invoke BPEL processing workflows.
Reference
- URL: http://<hostname>:8080/smila/pipeline/<workflow-name>/process
- Allowed methods: GET and POST
- Response Status Codes:
- 400 BAD REQUST: Empty input record or invalid JSON.
- 405 METHOD NOT ALLOWED
- 500 INTERNAL SERVER ERROR: Other errors, e.g. error during processing.
Current Limitations
- Exactly one non-empty input record must be sent, attachments cannot be added.
- Only the first result record is returned, attachments are ignored.
Example Session
You can use tools like CURL or Resty to invoke HTTP APIs from the command line. More convenient are browser extensions like RESTClient or Posterfor Firefox, cREST for Chrome or Simple REST Client for Opera. For sake of simplicity, the following examples were produced with Resty.
First an empty request:
$ resty http://localhost:8080
http://localhost:8080*
$ GET /smila/pipeline/SearchPipeline/process
{
"message" : "Cannot process an empty record."
} $ POST /smila/pipeline/SearchPipeline/process {
"message" : "Cannot process an empty record."
} $