In addition to the normal OData Channel capabilities, SAP NetWeaver Gateway also offers subscription and notification flow functionality.
Subscription is always done to a business object collection using a filter.
Example
A user may subscribe to all customers belonging to California and thus be notified as soon as a new California customer is created in the backend system or if there are any changes in any California customer.
The most important particular cases of the filter are:
Subscription to the whole collection (the filter is empty)
Subscription to a specific business object instance (the filter contains just an ID)
In order to enhance the usability of the Push and Pull Notifications in SAP NetWeaver Gateway, the users now have the option to receive Notifications in two formats:
ATOM XML
JSON
Note
Push - While subscribing for a push notification, the value of Accept HTTP header must be given as application/json in order to receive notifications in JSON format. Else, by default you receive notifications in ATOM XML format.
Pull - While subscribing for a pull notification, it does not matter what is passed in the Accept HTTP header. While pulling the notifications from the SAP NetWeaver Gateway system through the service, NOTIFICATIONSTORE, the value of Accept HTTP header should be the appropriate value in which the Notifications are desired.
A feed is simply a collection of notifications for an end-user. It is the result of user’s subscriptions to different collections. The notifications may be pushed automatically to the end-user or pulled.
Example
Example of a feed on a mobile device:
A Travel Request of $1500 from Martin Lacasse was received
Sales Order 123 was updated
The address of Customer 456 has changed
A new track inspection was assigned to your work center
To subscribe, a consumer sends a subscription request to SAP NetWeaver Gateway specifying a user and subscription content (collection, filter, delivery method, and so on.
SAP NetWeaver Gateway has to validate the request and to forward it further to backend.
If the subscription is accepted by the backend then it is saved by SAP NetWeaver Gateway in the subscription persistence layer and an acknowledgment is sent to the consumer. The process flow to unsubscribe is similar.
The backend tracks the changes in business objects and sends a change notification to SAP NetWeaver Gateway as soon as any change/create/update happens in the business object collection subscribed to.
SAP NetWeaver Gateway receives the notification, and forwards it to a consumer using the appropriate format and delivery method. If the consumer is a connectivity server it has its own logic to deliver the notification to end-devices.
The delivery address must have one of the following formats:
urn:sap-com:channel :<RFC destination>:<request URI>
http://... or https://...
Note that a subscription ID must exist for your user.
Syntax Example:
End of the code. |
Note that the list contains subscriptions for the current user only.
Syntax
End of the code. |
Note that a subscription ID must exist for your user.
Syntax
End of the code. |