public void TestMethod5() { ClientUtilManager.Ask().DelayedSOAPRequest() .After(TimeSpan.FromSeconds(10)) .ToConfigEndpoint("BasicHttpBinding_UnitTestService") .Request <IUnitTestService>(p => p.BlockFor(TimeSpan.FromSeconds(15)) ) .Schedule(); }
public void TestMethod1() { ClientUtilManager.Ask().DelayedHttpRequest() .SetHeader("x-test", "ciao") .SetParameter("val", "3") .Method("POST") .To(new Uri("http://requestb.in/142s9c81")) .After(TimeSpan.FromSeconds(5)) .WithRetry(1) .Schedule(); }
public void TestMethod4() { ClientUtilManager.Ask().PeriodicSOAPRequest() .After(TimeSpan.FromSeconds(10)) .Every(TimeSpan.FromSeconds(5)) .WithAllottedTime(TimeSpan.FromMinutes(2)) .AsFireAndForget() .ToConfigEndpoint("BasicHttpBinding_UnitTestService") .Request <IUnitTestService>(p => p.SendDateTimeToUrl("http://requestb.in/12wvclh1") ) .Schedule(); }
public void TestMethod7() { string jobId = ClientUtilManager.Ask().PeriodicSOAPRequest() .After(TimeSpan.FromSeconds(10)) .Every(TimeSpan.FromSeconds(5)) .WithAllottedTime(TimeSpan.FromMinutes(2)) .AsFireAndForget() .ToConfigEndpoint("BasicHttpBinding_UnitTestService") .Request <IUnitTestService>(p => p.SuccedAt(DateTime.Now + TimeSpan.FromSeconds(30)) ) .Schedule(); }
public void TestMethod3() { ClientUtilManager.Ask().DelayedSOAPRequest() .After(TimeSpan.FromSeconds(500)) .ToConfigEndpoint("BasicHttpBinding_ISchedulerService") .Request <ISchedulerService>(p => p.DelayedHttpRequestMessage("post", new Uri("http://requestb.in/142s9c81"), new Dictionary <string, string>() { { "x-cli", "yesN2" } }, new Dictionary <string, string>() { { "par", "yesN2" } }, TimeSpan.FromSeconds(5), 0, false)) .Schedule(); }
public void TestMethod2() { ClientUtilManager.Ask().DelayedSOAPRequest() .After(TimeSpan.FromSeconds(5)) .WithBinding(new BasicHttpBinding()) .Request <ISchedulerService>(p => p.DelayedHttpRequestMessage("post", new Uri("http://requestb.in/142s9c81"), new Dictionary <string, string>() { { "x-cli", "yesN2" } }, new Dictionary <string, string>() { { "par", "yesN2" } }, TimeSpan.FromSeconds(5), 0, false)) .To(new Uri("http://Code.test.aliaslab.net/SchedulerService/SchedulerService.svczzz")) //.To(new Uri("http://localhost:2213/SchedulerService.svc")) .Schedule(); }
public string Schedule() { if (_messageJson == null) { throw new ArgumentException("The message must be set"); } if (_channelName == null) { throw new ArgumentException("The channelname must be set."); } using (ChannelFactory <ISchedulerService> ch = new ChannelFactory <ISchedulerService>(ClientUtilManager.Ask().EndpointConfigurationName)) { ISchedulerService svc = ch.CreateChannel(); if (!string.IsNullOrEmpty(_CRONString)) { return(svc.CRONChannelMessage(_channelName, _broadcast, _messageJson, _CRONString, _timeLimit, _fireAndForget)); } else { return(svc.PeriodicChannelMessage(_channelName, _broadcast, _messageJson, _delay, _period, _timeLimit, _fireAndForget)); } } }
public string Schedule() { if (_messageJson == null) { throw new ArgumentException("The message must be set"); } if (_channelName == null) { throw new ArgumentException("The channelname must be set."); } using (ChannelFactory <ISchedulerService> ch = new ChannelFactory <ISchedulerService>(ClientUtilManager.Ask().EndpointConfigurationName)) { ISchedulerService svc = ch.CreateChannel(); return(svc.DelayedChannelMessage(_channelName, _broadcast, _messageJson, _delay, _retryCount, _fireAndForget)); } }
public string Schedule() { if (_dirty) { throw new InvalidOperationException("The data that produced the request has changed. Produce another request."); } if (_to == null) { throw new ArgumentException("The To must be set"); } using (ChannelFactory <ISchedulerService> ch = new ChannelFactory <ISchedulerService>(ClientUtilManager.Ask().EndpointConfigurationName)) { ISchedulerService svc = ch.CreateChannel(); return(svc.DelayedSOAPRequestMessage(_to.Host, _to.Port, Encoding.UTF8.GetBytes(SOAPRequestHelper.GetMangeldRequest(_soapMessage, _to)), _delay, _retryCount, _fireAndForget)); } }
protected virtual void StopJob(bool success) { using (ILoggingOperation log = _logger.NormalOperation()) using (ChannelFactory <ISchedulerService> ch = new ChannelFactory <ISchedulerService>(ClientUtilManager.Ask().EndpointConfigurationName)) { log.Wrap(() => { ISchedulerService svc = ch.CreateChannel(); JobContextData data = GetContextData(); if (data == null) { log.Debug("No JobContextData found."); } else { svc.StopJob(data.JobId, success); } }); } }
public string Schedule() { if (_to == null) { throw new ArgumentException("The To must be set"); } using (ChannelFactory <ISchedulerService> ch = new ChannelFactory <ISchedulerService>(ClientUtilManager.Ask().EndpointConfigurationName)) { ISchedulerService svc = ch.CreateChannel(); return(svc.DelayedHttpRequestMessage(_method, _to, _headers, _parameters, _delay, _retryCount, _fireAndForget)); } }
public string Schedule() { if (_to == null) { throw new ArgumentException("The To must be set"); } using (ChannelFactory <ISchedulerService> ch = new ChannelFactory <ISchedulerService>(ClientUtilManager.Ask().EndpointConfigurationName)) { ISchedulerService svc = ch.CreateChannel(); if (!string.IsNullOrEmpty(_CRONString)) { return(svc.CRONHttpRequestMessage(_method, _to, _headers, _parameters, _CRONString, _timeLimit, _fireAndForget)); } else { return(svc.PeriodicHttpRequestMessage(_method, _to, _headers, _parameters, _delay, _period, _timeLimit, _fireAndForget)); } } }