Exposing Your Project as a RESTful Service
After you create and deploy your project, it is available to you as either a SOAP-based web service or a RESTful service. If you choose to expose your project as a RESTful service you can execute your service using standard HTTP calls, sending and receiving common data formats such JSON and XML.
Step-by-Step
Tutorial 5: Importing a Service steps through the process of exposing your project as a REST service. It shows you how to use Web Service Explorer and online XML to JSON conversion tools to help determine what the JSON input to your RESTful service should look like.
In the tutorial you can also see an example of how to use the Curl utility to call the RESTful service. Curl is a command line tool for transferring data with URL syntax. You can see information about Curl on their web site, http://curl.haxx.se/
Things to remember
- The complete URL to the RESTful service is the base URL plus the project name and the name of the operation you want to call. For example:
Base URL:http://localhost:8282/vse/processes/
Complete URL: http://localhost:8282/vse/processes/<name_of_service>/<operation_name>
To view operations that are exposed by the project in the Service Explorer, first enable the option in Windows > Preferences > Project. - Process Designer services support the HTTP POST request type. POST request bodies are used to input data to the service - Content type may be application/JSON or application/XML. JSON is typically used in RESTful services. If the contentType is -application/json-. The means that the service will be expecting the input to be in JSON format and the output will also be in JSON format.
For a Process Designer service to be called RESTfully, its input must be a complex type. You cannot use simple inputs, such as strings, as input. In Process Designer all inputs and outputs are complex by default.
More information