Develop > Web Service Interfaces > Event Synchronization Web Service Interface > Event update: Logfile Adapter examples

Event update: Logfile Adapter examples

Note The examples showing event updates in this section are specific to the Logfile Adapter (the sample Groovy script adapter provided with the product), and would work only for the Logfile Adapter, or for accessing the Event Synchronization Web Service directly without having a Groovy script configured for the target connected server.

You can submit event changes with an event update. The HTTP method in this case is PUT, and the expected payload for the Logfile Adapter is an OprEvent. Each Groovy script adapter defines its own expected payload, so the expected payload would be different for other Groovy script adapters.

The Event Synchronization Web Service supports sending multiple properties in a single payload. The following examples each show just one changed property, with the exception of the last sample, which shows two changed properties (see Change Multiple Properties in One Call).

You can send test payloads to the Event Synchronization Web Service using the REST web service command-line utility RestWsUtil, supplied with the product. When using the utility, make sure that the event you are trying to update was first forwarded to the target connected server you are using to authenticate with the Event Synchronization Web Service.

For details about the RestWsUtil command-line utility, see RestWsUtil Command-Line Interface.

An example call for an event update is shown below. The following sample call for an event update is for a connected server named logger with password set to Password1, and attempts to update an event with the ID 0695624b-93fa-40b1-8b0fc9b4ea07a4ec. The sample call looks like this:

RestWsUtil -update update.xml-url "https://<server.example.com>/opr-gateway/rest/9.10/synchronization/event/0695624b-93fa-40b1-8b0fc9b4ea07a4ec" -username logger -password Password1 -verbose

The samples that follow show possible XML payloads for the call. The payloads are contained in the update.xml file referenced in the call to the RestWsUtil command-line utility.

Note An Event REST WS sample is located at:

<OMi_HOME>/opr/examples/event-ws

This can be compiled and packaged into a war file for deployment into a J2EE container. See the README.txt in this directory for instructions on how to build this webapp and deploy it for testing.

A Event REST WS template is located at:

<OMi_HOME>/opr/examples/synchronization-ws

This can be used as a starting point for developers who want to develop their own Event Synchronization web service. See the README.txt in this directory for instructions on how to build this webapp. The "TODO" sections must be completed by the developer.