Ok thanks I'll try that by changing the setting on a related issue I am trying to do a webhook double hop for an inventory update which has service function like
- Code: Select all
public ServiceStack.Web.IHttpResult Post(JiwaFinancials.Jiwa.JiwaServiceModel.Inventory.InventoryItem request)
but request is the correct InventoryIem but all the properties aren't being set however, in other words it not deserializing the body
- Code: Select all
string reqbody = base.Request.GetRawBody();
will actually get me the data that I need to do the hop but it seems a bit cludgy, I tried looking at IRequiresRequestStream but that didn't work any ideas on how to make it deserialize the body, in web api there is an annotation to do it?
The webhook message timer constructor is
- Code: Select all
public WebhookMessagesTimer(int TimerInterval)
{
_timer = new System.Timers.Timer { AutoReset = false, Interval = TimerInterval };
_timer.Elapsed += delegate
{
_timer.Stop();
// List<System.Threading.Tasks.Task> tasks = new List<System.Threading.Tasks.Task>();
// Process the message queue
List<SY_WebhookMessage> messages = RESTAPIPlugin.WebhookMessages.OrderBy(x => x.ItemNo).ToList<SY_WebhookMessage>();
foreach (SY_WebhookMessage message in messages)
{
// System.Threading.Tasks.Task task = System.Threading.Tasks.Task.Factory.StartNew(() => { WebHookController.CallWebhook(message); } );
// tasks.Add(task);
WebHookController.CallWebhook(message);
}
// if (tasks.Count > 0)
// {
// System.Threading.Tasks.Task.WaitAll(tasks.ToArray());
// tasks.Clear();
// }
_timer.Start(); // restart the timer
};
_timer.Start();
}