on ‎2020 Oct 08 2:41 PM
Hello all,
I would like to integrate webhooks generated by an external application into ByDesign through SAP Cloud Application Studio (ByDesign or C4C). If anyone has already made it, could you give me an overview of what elements are needed please ?
My external application can generate html POST webhooks or SOAP webhooks. As far as I know, like the x-csrf-token is needed for POST OData action, my only option is to integrate SOAP webhooks.
Thanks for your help,
Best regards
Request clarification before answering.
Dear Solène,
the two possibilities to make a custom inbound interface are OData or SOAP.
For OData you will need to create a Custom Business Objekt in SDK and create an OData service in the admin work center within ByD. For the POST request you will need to use the x-csrf-token header, it will not work without. Also the JSON/XML you are receiving needs to have the compatible format (standard OData).
For SOAP you will also need to create a Custom Business Object in SDK and create a inbound service in SDK too. With that and the corresponding communication agreement you can create the necessary request from the WSDL. This also implies that the 3rd party can send a valid SOAP request which fits the schema of the WSDL.
Unfortunately there is no way to define some kind of "freestyle" endpoint which can receive and work with any kind of data structure.
Best regards
Jürgen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Jürgen,
Thanks for this summary.
In my case, the 3rd party can not manage x-crsf token, so OData is excluded.
In the SOAP scenario, the service is already created by the 3rd party (standard on their side). I created an External webservice integration based on the wsdl provided by the 3rd party (and the communication agreement). But what should be done regarding the custom BO ? How can I create a BO that will perfectly fit the data given by the message ?
Thanks, best regards
Dear Solène,
for the inbound communication via SOAP you have to create a Custom BO in the SDK. For that BO you will define a Web Service: https://help.sap.com/viewer/cbcebe3cfb1647a8b0322c18dbb0b481/2020.08/en-US/74f86f6073e210149e3fd0678...
That means that the WSDL will be generated by the SDK, which you cannot manipulate in any way.
So your 3rd Party must work with the WSDL generated by the SDK. You cannot use their WSDL as an inbound service definition.
Best regards
Jürgen
Dear Jürgen,
Thanks for this answer. Thus, in a situation like mine where : the 3rd party has deployed two web-hooks methods : POST and SOAP standards on their side and non-customizable, we are not able to integrate webhooks into ByD.
Sad situation because webhooks are quite useful.
Thanks,
Best regards,
Hi Solene,
What Jürgen and Saurabh suggested would work.
However, in C4C (unfortunately, I don't have access to ByDesign to confirm), there are ways you can go with OData without CSRF token.
Please check C4C OData documentation here:
https://github.com/SAP/C4CODATAAPIDEVGUIDE#csrf-token
And this blog post:
No need for CSRF token when calling C4C OData
Hope this helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can integrate webhooks into SAP C4C using SAP Cloud application studio. In order to do so you would need to:
1. Create an external web service interaction using the webhook URL.
2. Configure the generate communication arrangement for web service integration created in last step.
3. Now call the web service webhook via ABSL code based on your business need using reuse library WebServiceUtilities.ExecuteRESTService.
For more details please refer: https://blogs.sap.com/2018/12/06/use-restful-service-to-consume-s4-functionality-in-sap-cloud-for-cu...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Saurabh,
Thanks for your answer.
However, I am not sure that my case is similar to the case in the blog post. I need my ByD to be able to receive passivly data from a third party. There is no trigger on ByD (different from the C4C button in the blog post). The external system sends webhooks depending some events on their side and ByD needs to able to receive them.
Indeed, I assume it requires a external webservice integration. The third party external system requires an URL where to send the data, what would it be please ?
Thanks
Fetching a CSRF token is fairly simple as it is quite a standard procedure in all of the SAP API communications and there are a lot of blogs and discussion post available on SCN that talks about how to deal with it.
In case your system is unable to make a GET call to fetch CSRF token then as a workaround you can build a simple wrapper API, maybe using CPI iflow or SCP API Management. This sample API end point will be triggered by your external system as a POST call but within this API you can make GET call to fetch the CSRF and then handle POST to do the data operation.
Using a between API to manage csrf token is a good idea. I will think about it but I do not think I will manage to do it because this development is running without any middelware (SCPi or other), it is only third-party system (that only launch POST request and I can not modify anything on it) , SAP Cloud App Studio and ByD.
Thanks
| User | Count |
|---|---|
| 15 | |
| 9 | |
| 6 | |
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.