
Setting Up Consumer-Specific Configuration on SAP NetWeaver Gateway: - Logon to your SAP NetWeaver Gateway host and in transaction SM59 create an RFC destination of type G (HTTP Connection to External Server) pointing to your PC.
Subscribing for sample user collection: - Provide a service user and password for the destination(s) To test subscriptions/notifications post an XMLHttpRequest to the SubscriptionCollection of your OData Channel application URL.
Request
POST /iwfnd/RMTSAMPLEFLIGHT/SubscriptionCollection HTTP/1.1
Host: <host>:<port>
accept: application/atom+xml
content-type: application/atom+xml
Content-Length: 634
X-Requested-With: XMLHttpRequest
<?xml version="1.0" encoding="utf-8"?>
entry xml:base="http://<host>:<port>/sap/opu/odata/IWFND/RMTSAMPLEFLIGHT/" xmlns="http://www.w3.org/2005/Atom"
xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices">
<id>http://<host>:<port>/sap/opu/odata/IWFND/RMTSAMPLEFLIGHT/SubscriptionCollection('00163EA725801ED29598CE35319B1772')</id>
<title type="text">My sub</title>
<updated>2013-01-02T10:23:26Z</updated>
<author>
<name>SAPUSER</name>
</author>
<category term="RMTSAMPLEFLIGHT.Subscription" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
<link href="SubscriptionCollection('005056A509B31ED2849EFB180361F2D6')" rel="edit" title="Subscription"/>
<content type="application/xml">
<m:properties>
<d:ID>00163EA725801ED29598CE35319B1772</d:ID>
<d:deliveryAddress>HTTP://10.xx.xxx.000:xxxx<d:deliveryAddress>
<d:persistNotifications>false</d:persistNotifications>
<d:collection>FlightCollection</d:collection>
<d:filter/>
<d:select/>
<d:changeType>created</d:changeType>
</m:propertied>
</content>
</entry>
|
The different parts of the source code are explained in the following sections.
<d:deliveryAddress>
The delivery address must have one of the following formats:
urn:sap-com:channel:<RFC destination>:<request URI>
http(s)://<host>:<port>/...
In both cases an RFC destination of type G (HTTP destination to external server) must exist on SAPÂ NetWeaver Gateway either with the name <RFC destination> or targeted to the <host>:<port>.
The comparison is case-insensitive and it is performed for strings (that is, no DNS names resolution, and so on).
For example, if you want to subscribe with delivery address http://endpoint.somewhere.com:8000/application/user-inbox there must be an RFC destination with target host endpoint.somewhere.com and target port 8000.
<d:filter> - The filter attribute must follow the
OData $filter notation (see http://www.odata.org/developers/protocols/uri-conventions#FilterSystemQueryOption
) and may combine any fields using the
AND operation only.
SAPÂ NetWeaver Gateway does not evaluate any filter criteria.
<d:changeType> - The changeType attribute must be one of the following - "created", "updated" "failed" or "deleted". changeType property allows you to subscribe for notifications based on a particular operation performed in the SAP backend. For example, if you want to subscribe for notifications only when a create operation is done, then the changeType would be "created". Users will have to develop application specific handling for sending notifications based on the subscribed changeType. Hence, for the above example given, the user is not notified when an update or a delete operation is performed on the object for the subscribed collection in the SAP backend.
Testing Notifications
Before you can test your notifications make sure that you have already created a subscription in the first place.
Create a copy of report /IWBEP/R_MGW_PUSH_TEST.
Set a value of your model group for variable LC_TECHNICAL_GROUP_NAME.
Set a name of the collection you have created the subscription for in variable LC_FLIGHT_COLLECTION.
Save and activate your report.
Execute your report.
Back to Configurations on the SAP Backend System for Pull Oriented Scenarios