bytedev

How to respond to notification events

0 votes
I have created a .Net web application to receive posts from the eSignLive server to handle event notifications (PACKAGE_CREATED, DOCUMENT_SIGNED, etc.) I am successfully receiving the events, parsing the Json posted to me, and handling the events. My post method is returning an HttpResposeMessage with a Status of 'OK', but for some reason, the eSignLive server is sending me emails telling me that the callback failed because it failed to contact the callback server. It certainly did contact my server, so I'm assuming that it might be expecting something more from me in the HttpResponseMessage, in order for the server to know that I received and handled the post. What do I need to do in order to correctly respond to these eSignLive event notification posts, so that I do not get these failure emails? I am currently testing using the sandbox server, if that matters.

Reply to: How to respond to notification events

0 votes
Hey there, That is indeed an odd behavior. I would suggest verifying the url you set in your notifier. eSignLive might be not resolving it correctly. Also, make sure you have HTTP POST enabled on your event listener. below are logs from a web app using eSignLive's callback event notifications that might be helpful to you. You can also have a look at this code share: https://developer.esignlive.com/code-share/e-sl-event-integration-google-app-engine/ The code is in python but it gives you a pretty a good idea how to integrate esignlive's event notifications.
2016-08-31T14:16:23.832884+00:00 heroku[router]: at=info method=POST path="/eslNotification" host=esl-listener.herokuapp.com request_id=7904fa68-5c09-4cd5-992f-ce74c07b0b13 fwd="54.84.89.182" dyno=web.1 connect=0ms service=11ms status=200 bytes=108
2016-08-31T14:16:23.808574+00:00 app[web.1]: 2016-08-31 14:16:23.808 TRACE 3 ---[tp1186863438-20] c.s.p.e.c.EslNotificationsController     : received notification PACKAGE_CREATE for package id 3ZiDNGoMUaEU-1SQdb97XNr8eqM=
2016-08-31T14:16:23.813170+00:00 app[web.1]: 2016-08-31 14:16:23.813 DEBUG 3 ---[tp1186863438-20] o.s.m.s.b.SimpleBrokerMessageHandler     : Processing MESSAGE destination=/topic/eslNotifications session=null payload={"name":"PACKAGE_CREATE","sessionUser":"ZQI8k6faVoM8","packageId":"3ZiDNGoMUaEU-...(truncated)
2016-08-31T14:16:23.813322+00:00 app[web.1]: 2016-08-31 14:16:23.813 DEBUG 3 ---[tp1186863438-20] o.s.m.s.b.SimpleBrokerMessageHandler     : Broadcasting to 1 sessions.
2016-08-31T14:16:23.814729+00:00 app[web.1]: Connect-Time: 0
2016-08-31T14:16:23.814727+00:00 app[web.1]: POST /eslNotification HTTP/1.1
2016-08-31T14:16:23.814730+00:00 app[web.1]: X-Request-Id: 7904fa68-5c09-4cd5-992f-ce74c07b0b13
2016-08-31T14:16:23.814731+00:00 app[web.1]: Connection: close
2016-08-31T14:16:23.814732+00:00 app[web.1]: User-Agent: Apache-HttpClient/4.3.3 (java 1.5)
2016-08-31T14:16:23.814733+00:00 app[web.1]: X-Forwarded-Proto: https
2016-08-31T14:16:23.814734+00:00 app[web.1]: X-Request-Start: 1472652983820
2016-08-31T14:16:23.814734+00:00 app[web.1]: Total-Route-Time: 0
2016-08-31T14:16:23.814735+00:00 app[web.1]: Host: esl-listener.herokuapp.com
2016-08-31T14:16:23.814735+00:00 app[web.1]: Accept-Encoding: gzip,deflate
2016-08-31T14:16:23.814736+00:00 app[web.1]: X-Forwarded-Port: 443
2016-08-31T14:16:23.814737+00:00 app[web.1]: Via: 1.1 vegur
2016-08-31T14:16:23.814737+00:00 app[web.1]: X-Forwarded-For: 54.84.89.182
2016-08-31T14:16:23.814738+00:00 app[web.1]: Content-Length: 188
2016-08-31T14:16:23.814738+00:00 app[web.1]: Content-Type: application/json; charset=UTF-8
2016-08-31T14:16:23.814739+00:00 app[web.1]:
2016-08-31T14:16:23.814740+00:00 app[web.1]: {"@class":"com.silanis.esl.packages.event.ESLProcessEvent","name":"PACKAGE_CREATE","sessionUser":"ZQI8k6faVoM8","packageId":"3ZiDNGoMUaEU-1SQdb97XNr8eqM=","message":null,"documentId":null}
2016-08-31T14:16:23.814740+00:00 app[web.1]:
2016-08-31T14:16:23.814741+00:00 app[web.1]: HTTP/1.1 200 OK
2016-08-31T14:16:23.814742+00:00 app[web.1]: Connection: close
2016-08-31T14:16:23.814743+00:00 app[web.1]: Date: Wed, 31 Aug 2016 14:16:23 GMT

2016-08-31T14:16:23.814743+00:00 app[web.1]:
2016-08-31T14:16:23.814744+00:00 app[web.1]:
2016-08-31T14:16:23.814744+00:00 app[web.1]:
Haris Haidary OneSpan Technical Consultant

Reply to: How to respond to notification events

0 votes
Thanks for the thoughts. Again, my listener is receiving post requests just fine. it is serializing the Json received just fine. It is processing them just fine. All I need to know is whether the ESignLive servers are expecting Json back in the Content property of the HttpResponseMessage, and in what form that Json needs to be in, so that I can properly inform their servers that I handled the request, so I don't get the 'Failed to communicate with server' messages. The server did NOT fail to communicate with me. I just need to know how (apparently) to tell the server that. If no Json is required in the response, then I will have to start looking elsewhere, but this seemed the most likely answer to the problem. So, to restate, all I am looking for is the answer to the question of whether the ESignLive servers are expecting Json back on the Content property of the HttpResponseMessage class, and in what form that Json would take.

Reply to: How to respond to notification events

0 votes
No, eSignLive does not require you to send a JSON payload back when you receive the event notification.
Haris Haidary OneSpan Technical Consultant

Reply to: How to respond to notification events

0 votes
So is the server timing out waiting for my response then? If so, is there any example code you can point me to that would demonstrate how to set up a web application (.Net) controller with the correct type of asynchronous methods? The reason I asked the above question is because I have another vendor who DOES expect to get Json back in the response. Since not all of my requests are causing the eSignLive servers to send me a failure email, I'm thinking that it is taking too long for me to respond, and that is the cause. But I have found no example code that would point me in the right direction on how to define my controller methods properly to handle the requests asynchronously (if that is what is required).

Reply to: How to respond to notification events

0 votes
If I'm understanding correctly, you are doing the following:
  1. receive the json payload from esignlive
  2. use the info in the json to do some other tasks
  3. when all tasks are completed, send the 200 OK response back to esignlive
If this indeed the case, then definitely the request times out after x number of seconds. For obvious reasons, esignlive will not wait indefinitely for you to send a 200 OK response back. I would advise you to send the response back to esignlive as soon as you receive the json payload and then subsequently complete whatever tasks need be done.
Haris Haidary OneSpan Technical Consultant

Reply to: How to respond to notification events

0 votes
Hello Haris, We would like to know how long (Response time in seconds) does the call back notifications will wait for the response 200 OK.

Reply to: How to respond to notification events

1 votes
Hey Karan, I'm not exactly sure how long esignlive waits for the 200 response before it times out. You can run a few tests on your side and see what works for you but I would suggest you follow standard protocol and send the 200 response back as soon as you receive the notification event. Cheers,
Haris Haidary OneSpan Technical Consultant

Reply to:

0 votes

I've noticed you set this up on Heroku. Can you tell me if there is an add-on or other type of configuration I need to set up to get the listener working on Heroku?

 

**EDIT**

Disregard. I was using my registered domain instead of heroku's "myapp.heroku.com". Once I started using that, the service worked.


Hello! Looks like you're enjoying the discussion, but haven't signed up for an account.

When you create an account, we remember exactly what you've read, so you always come right back where you left off