EventNotification in DocuSign SOAP based API - vb.net

I am using EventNotification with DosuSign SOAP based API. The problem is i am not received any Request on the URL (that i mentioned in the definition of Event Notification) when any event occurs for Envelope.
Following are my code snippet: (here i required notification when envelope is completed)
Dim EnvelopeNotificationURL As String = "https://{my url}"
Dim EventNotifi As New EventNotification
EventNotifi.URL = EnvelopeNotificationURL
EventNotifi.LoggingEnabled = True
'Defining Envelope Events
Dim envEvent(0) As EnvelopeEvent
envEvent(0) = New EnvelopeEvent
envEvent(0).EnvelopeEventStatusCode = EnvelopeEventStatusCode.Completed
EventNotifi.EnvelopeEvents = envEvent
NewEnvelope.EventNotification = EventNotifi
'// Here NewEnvelope is an instance of Envelope Class.

There are at least a couple of possibilities here:
The event notification portion of your XML Request isn't correct/complete. I'd suggest that you update your question to include a trace of the complete XML Request that's being sent to the server (you can easily generate this trace using Fiddler or a similar tool), so that we can examine the full XML request and rule out any issues with its format/contents.
The XML Request format/contents is fine, and Connect is attempting to send the message to your listener when the Envelope is Completed, but there's an issue preventing the message from being delivered to your listener. I'd suggest that you check the DocuSign Connect Logs (in the DocuSign web console) to determine: 1) if messages are being sent and 2) if there are issues with the message reaching the listener endpoint. The Connect Service guide (http://www.docusign.com/sites/default/files/DocuSign_Connect_Service_Guide.pdf) contains information about how to view the logs.
If you can update your question with information about what you're seeing in the Connect log file, and also include a trace of the full XML request that's going to the server, I'll update this answer with additional feedback.

Related

Can we monitor for a particular text like (Name=abc) in API response and get notified in Postman?

API Testing:
Currently, I am using Postman to test API response
I want to monitor a particular text in API response and get notified for example-
{
"productname": "PARLE",
"customer": "ABC",
}
If I get a customer name in the API response as ABC I want to get notified through mail or slack or anything.
Is this possible? if Yes please share me the inputs.
you can run periodic tests with a software like Overseer, and receive notifications using a Notify17 notification template (see the sample recipe).
You could use a test rule like:
http://myurl.com/path must run http with not-content '"customer": "ABC"'
To have an easy start with Overseer, you can check out the Kubernetes deployment example.
You can achieve your use case using Postman Monitors to send an email or send a slack message by following these steps:
Configure your monitor to run with an environment. (Reference: https://learning.getpostman.com/docs/postman/monitors/intro_monitors/)
In the test script of your Collection's Request, fetch the response using pm.response.json() (Based on the response structure you mentioned)
Use the following code snippet to determine whether the response contains what you need:
if (pm.response.json().customer === 'ABC') {
// no op
}
else {
postman.setNextRequest(null);
}
Here, if the condition is not met, then the next request that will be executed is null, which means that the collection execution will stop here. However, if the condition is met, this will not be set and the next request will be executed.
You can use various Public APIs to achieve tasks like send an email or send a slack message:
Gmail API | Slack API
Create a request below the current request titled 'Send notification'. Use the documentation provided to set the request up.
When your monitor runs, if the condition is not met, then postman.setNextRequest will be set to null and the 'Send notification' request will not run. However, if the condition is indeed true, then the request will run and you will receive a notification on the respective channel.

SmartRule For HTTP

In the Cumulocity guide, https://www.cumulocity.com/guides/event-language/introduction/, there is a mention of Event Streams for HTTP.
HTTP ResponseReceived SendReqeust This group of events represents sending http requests to external services.
This means we can send outbound HTTP request to external services using the "SendRequest" stream. However, I did not find any further details in any documentation. Can you please provide the template CEL details for SendRequest, and how to configure the same in Cumulocity?
I can not help you using the actual engine (Apama) but I can give you one example using Esper.
#Name("Sending the http request")
#Resilient
insert into
SendRequest
select
'post' as method,
'https://tenant.cumulocity.com/inventory/managedObjects' as url,
'Basic .....' as authorization,
'application/json' as contentType,
toJSON(m) as body
from anyEventStream m;
The toJSON if a function that takes the event stream and return is equivalent in json.
You can find more info here. This info is hide from the actual docs and think it is because they want to push developers to use APAMA instead ESPER.
Hope this helps.

Capture start of long running POST VB.net MVC4

I have a subroutine in my Controller
<HttpPost>
Sub Index(Id, varLotsOfData)
'Point B.
'By the time it gets here - all the data has been accepted by server.
What I would like to do it capture the Id of the inbound POST and mark, for example, a database record to say "Id xx is receiving data"
The POST receive can take a long time as there is lots of data.
When execution gets to point B I can mark the record "All data received".
Where can I place this type of "pre-POST completed" code?
I should add - we are receiving the POST data from clients that we do not control - that is, it is most likely a client's server sending the data - not a webbrowser client that we have served up from our webserver.
UPDATE: This is looking more complex than I had imagined.
I'm thinking that a possible solution would be to inspect the worker processes in IIS programatically. Via the IIS Manager you can do this for example - How to use IIS Manager to get Worker Processes (w3wp.exe) details information ?
From your description, you want to display on the client page that the method is executing and you can show also a loading gif, and when the execution completed, you will show a message to the user that the execution is completed.
The answer is simply: use SignalR
here you can find some references
Getting started with signalR 1.x and Mvc4
Creating your first SignalR hub MVC project
Hope this will help you
If I understand your goal correctly, it sounds like HttpRequest.GetBufferlessInputStream might be worth a look. It allows you to begin acting on incoming post data immediately and in "pieces" rather than waiting until the entire post has been received.
An excerpt from Microsoft's documentation:
...provides an alternative to using the InputStream propertywhich waits until the whole request has been received. In contrast, the GetBufferlessInputStream method returns the Stream object immediately. You can use the method to begin processing the entity body before the complete contents of the body have been received and asynchronously read the request entity in chunks. This method can be useful if the request is uploading a large file and you want to begin accessing the file contents before the upload is finished.
So you could grab the beginning of the post, and provided your client-facing page sends the ID towards the beginning of its transmission, you may be able to pull that out. Of course, this would be reading raw byte data which would need to be decoded so you could grab the inbound post's ID. There's also a buffered one that will allow the stream to be read in pieces but will also build a complete request object for processing once it has been completely received.
Create a custom action filter,
Action Filters for executing filtering logic either before or after an action method is called. Action Filters are custom attributes that provide declarative means to add pre-action and post-action behavior to the controller's action methods.
Specifically you'll want to look at the
OnActionExecuted – This method is called after a controller action is executed.
Here are a couple of links:
http://www.infragistics.com/community/blogs/dhananjay_kumar/archive/2016/03/04/how-to-create-a-custom-action-filter-in-asp-net-mvc.aspx
http://www.asp.net/mvc/overview/older-versions-1/controllers-and-routing/understanding-action-filters-vb
Here is a lab, but I think it's C#
http://www.asp.net/mvc/overview/older-versions/hands-on-labs/aspnet-mvc-4-custom-action-filters

Update body of a "FailedMessages"-document in ravendb (servicecontrol instance )

I want to be able to retry a failed NServicebus message but with an updated body.
I have successfulle updated the body tag in ravendb (the servicecontrol instance) of a "FailedMessages" Document
but
the api still returns the old body (from the bodyUrl). So when i retry the message from our custom document viewer the body is still the old when reaches the Handler.
Is it possible to update the body?
-EDIT-
When you do a retry using the Servicecontrol API. Is it the message that is in the error queue that is resent or is it data collected from the servicecontrol ravendb instance that are put together and sent?
It is not possible to update the body of a message, it goes against the basic principle of messages are immutable...
If there is a business reason to modify the data then it should be done by your application logic i.e. a reconciliation process.
Make sense?
EDIT:-
Error messages are processed from the error queue and stored in a RavenDB document, when a retry or a retry batch is invoked the message is composed and sent to the original endpoint that was processing the field message. Just to be clear.
Please note: ServiceControl's API is not a public and supported API...
I just managed to update the body of a message. It is possible after all.
Here is some sourcecode from ServiceControl:
DocumentStore.DatabaseCommands.PutAttachment("messagebodies/" + bodyId, null, bodyStream, new RavenJObject
{
{"ContentType", contentType},
{"ContentLength", bodySize}
});
Previously I tried to update the FailedMessage document which has a body tag. But I needed to update the Attachment. The bodyId in the above code is not the UniqueMessageId but MessageId found in ProcessingAttempts -> MessageMetadata -> MessageId.

rtbkit create add exchange that can send bid via UI

How to create an add exchange for POC for RTBKIT.I want to create end to end program such that there is UI which send a parameter height and width and that request goes to rtbkit and then response will send a URL and that imag will be displayed on UI.
For performing this,we need an exchange that can send request to rtbkit running at your system.
http://integration.rubiconproject.com/rtb/request
The solution will be create a web application that will call this add exchange via selenium or HttpClient and fill the RTB Endpoint.This will call the rtbkit instance running at your system and in response you will get image of the bidding agent that won during this process and we will show that image at our website.