cancel
Showing results for 
Search instead for 
Did you mean: 

Push Notification to Middleware APIGW

deepthi_b
Participant
0 Kudos

Hi All,

My requirementnt is to send Notification of ODATA services to Middleware from SAP using websocket so that as soon as the middleware receives notification they will make a call to SAP system to get latest data.

we have explored push notifications using SMP and configured all the steps. Our Middleware is able to receive the papyload. But they want to use Websocket technology so bidirectional connectivity will be established and as soon as the notification is received by middleware they can get the required data from backend .

I am unable to understand few points in the SMP set up. Its mentioned that Notifications are based on Push technology.

There are 2 classes identified as Push channels . Whats the purpose of these 2 classed

1./IWNGW/CL_OUT_NF_WS_AGENT - Able to find this tagged to Push Channel /IWNGW/NOTIFICATION_PUSH_APC

2./IWNGW/CL_OUT_NOTIF_SMP - Unable to find any Push channel linked to this class.

Do we need to share the push channel URL along with SAP system Host & Port to our Middleware so they will configure the URL to receive the notification ? If yes , how do they call our ODATA to get the required payload.

http://host:port/sap/bc/apc/iwngw/notification_push_apc

or

I am able to send the notification to Middleware using demoprogram which generated below URL .Does our Middleware team need to configure this URL?

Is this data passed thru this URL via websocket.

http:HOST:Port/DemoMDHNotification/v1/test/I123456/MDHNotification/restnotification/capability/Action-toappstatesample

Thanks & Regards

Deepthi

View Entire Topic
maheshpalavalli
Active Contributor
0 Kudos

/IWNGW/NOTIFICATION_PUSH_APC , this is for Fiori Notifications. For push channels, use the below blog post for reference.

https://blogs.sap.com/2013/11/18/websocket-communication-using-abap-push-channels/

1. You need to give the URL that you get from the above blog post.

2. you need to create another odata service (URL) for them to fetch the data from SAP system. So when you send a message to the subscribers, they will be notified, and will fetch the data service.

deepthi_b
Participant
0 Kudos

Hi Mahesh,

Thank you for quick reply.

When I execute demo program /IWNGW/R_BEP_DEMO_CREATE_NOTIF that is used to send Notification,

first SAP_WEBSOCKET is getting called .Class /IWNGW/CL_OUT_NF_WS_AGENT is tagged to this channel ID.

As per debug no data is sent through this channel only command "Notification" is called.

Later SAP_SMP channel ID is called which has logic to call the SMP server and send the data in JSON format.

My doubt is whether SAP_WEBSOCKET is used to call the websocket and later SAP_SMP will push the Notification via websocket that is called by SAP_WEBSOCKET.

Thanks & Regards

Deepthi

maheshpalavalli
Active Contributor
0 Kudos

deepthi.b

I used Fiori notifications a long time back and one thing I can tell for sure is that it is kind of linked to workflow & fiori. This is how it works, if a workitem is created or a notification is created, subscribers to the notification channel will be notified and no data is sent there, then the Fiori launchpad will send a read call to get all the notification and show the count is FLP. So in my opinion, better not to use this Fiori notifications framework and do something like what they are doing especially if your scenario is sending data to middleware to update db there else if it is just notifications, then you can use this framework.

Not sure about SMP channel, for sure it is related to SAP Mobile platform, don't know if you can reuse it.

deepthi_b
Participant
0 Kudos

Hi Mahesh,

Thank you for your response.

if a workitem is created or a notification is created, subscribers to the notification channel will be notified and no data is sent there, ...does the subscribers(applocations) configure the Push channel path along with host and port name in their application so notification will be sent to them via websocket?

We want to send Notification to Middleware in json format. Based on this Input ,middleware will call respective ODATA service to get the data.

From your explanation I understand that SAP is doing this for Fiori Notifications . I think we can explore this feature and do required customization where possible.

When we are trying to test the Push channel path from browser getting blank page..and if are trying from SAP then getting 403 forbidden error...Any idea how to overcome this issue and see the output of standard push channels.

Thanks & Regards

Deepthi

maheshpalavalli
Active Contributor
0 Kudos

deepthi.b

Okay, but the data is not sent to the subscribers, they will only be notified and subscribers(Fiori Launchpad) will fetch all the notifications using an OData service and shows it.

I hope you are testing the WebSocket correctly. e.g.,

https://www.koskila.net/how-to-test-a-web-socket-connection-in-browser/

and SAP WebSockets needs to be authenticated, hope you are authenticating them, else it will not work.