Preparing to send status to REST web services
- Learn the requirements for communication with the REST web service for the application:
- The values for authenticating with the application
- The values for requesting data from the REST web service
- The format of the data provided in the response
Refer to the documentation for the application or consult with the company that hosts the application.
- To prepare RICOH ProcessDirector to communicate with the application, do these tasks:
- If the application requires a security certificate, install the certificate on the RICOH ProcessDirector primary computer.
- If your environment requires a proxy server to communicate with web services, set up the system to use it.
For more information, see the related tasks.
- Run a manual test that authenticates with the application and requests a response
from the REST web service. Verify that the web service returns the response that you
want.Many browsers have plug-ins, such as Boomerang for Google Chrome, that test web service calls to REST clients.
- Decide on the event that you want to trigger the notification and the conditions that
determine when the notification calls the web service.If you want to send a notification for an event that occurs only when a specific workflow processes a job, specify that workflow as a condition.
- Define a REST web service notification:
As an alternative, you can copy the supplied RestfulWebServiceSampleNotify REST web service notification.
- Click the Administration tab.
- In the left pane, click .
- Click .
- On the General tab, type a name for the notification.
- On the Request tab:
- Set the Request URL property to the URL of the web service that you want to notify.
- Set the Request method property to the value required by the web service.
- For the value of the Request payload property, specify the body of the web services request that the input device submits
to the application.In this XML example, the payload contains two XML elements: <Token> and <OrderNumber>.
The value for each element is a RICOH ProcessDirector symbol containing a property. If you are using a web service to authenticate with the application, include the WSNotification.WebService.Credential property in a symbol. Replace the other element and property with the elements and properties that you want to send to the application. The notification resolves the symbols when it sends status to the REST web service.
- Set the values for the Request header and Request parameters properties, as required.Each header field or parameter is a keyword/value pair. Each pair must appear on a separate line and must be separated using a colon (:) or equals sign (=).
The keyword and value can be multiple words. RICOH ProcessDirector uses the first colon or equals sign on each line to split the words into the keyword/value pair.
This example contains three parameters: token, orderNumber, and customerName. The value of each keyword is a RICOH ProcessDirector symbol. Each symbol contains one of these properties: WSNotification.WebService.Credential, Job.Info.Attr1, and Job.CustomerName.
The input device resolves the symbols when it sends status to the REST web service.
- If your environment requires a proxy server to communicate with web services, set the Use proxy property to the correct proxy server.
- On the Authentication tab, specify the values required to authenticate with the application.For more information, see the related task about authenticating with a REST web service.
If the application does not require authentication, leave all the Authentication properties blank.
- On the Event tab:
For example, to send a notification when the state of a job changes to Retained, select Current job state, Changes to, and Retained.
- Choose the type of object to be monitored.
- Select the property, the action, and the value to monitor.
- To define another event, click + to the right of any event.
- To delete an event, click - to the right of the event you want to delete.
- On the Conditions tab:
For example, to send a notification only when a child job is in the ProcessWebOrders workflow, specify two conditions:
- Select the property and the value that must be satisfied before any notifications are sent.
- To define another condition, click + to the right of any event.To specify how the conditions are combined, select Any, All, or Custom.
- To delete a condition, click - to the right of the condition you want to delete.
- Workflow = ProcessWebOrders
- Job number like *.*
To apply the conditions only when a job meets both of them, select All.
- When you finish, click OK.
When you finish setting up your input devices, notifications, and workflows, test the exchange of data between RICOH ProcessDirector and the application.
Examine the supplied RestfulWebServiceSampleNotify REST web service notification.