/// <summary> /// Instantiates and transmits all data to the middle tier web service that will execute the Flow /// </summary> public ProcessResult Send() { ProcessResult returnValue = new ProcessResult(); var result = TypeExtension.DefaultString; // Call middle tier to process HttpRequestPostString request = new HttpRequestPostString(this.ProcessServiceURL, this.Serializer.Serialize(this.DataIn)); result = request.Send(); returnValue = this.Deserializer.Deserialize(result); return(returnValue); }
/// <summary> /// Instantiates and transmits all data to the middle tier web service that will execute the Flow /// </summary> public async Task <ProcessResult> SendAsync() { ProcessResult returnValue = new ProcessResult(); var result = TypeExtension.DefaultString; HttpRequestPostString request = new HttpRequestPostString(this.ProcessServiceURL, this.Serializer.Serialize(this.DataIn)); result = await request.SendAsync(); returnValue = this.Deserializer.Deserialize(result); return(returnValue); }
public async Task Net_HttpRequestPostString_SendAsync() { var dataOut = TypeExtension.DefaultString; var configuration = ConfigurationManagerSafeTests.ConfigurationManagerSafeConstruct(); var request = new HttpRequestPostString(configuration.AppSettingValue("MyWebService") + "/HomeApi"); try { dataOut = await request.SendAsync(); Assert.IsTrue(request.Response.IsSuccessStatusCode); throw new WebException(); } catch (WebException) { Assert.IsTrue(dataOut != null); } finally { request.Dispose(); } }
public async Task Core_Net_HttpRequestPostString_SendAsync() { var dataOut = string.Empty; var configuration = new ConfigurationManagerCore(ApplicationTypes.Native); var request = new HttpRequestPostString(configuration.AppSettingValue("MyWebService") + "/HomeApi"); try { dataOut = await request.SendAsync(); Assert.IsTrue(request.Response.IsSuccessStatusCode); throw new HttpRequestException(); } catch (HttpRequestException ex) { Assert.IsTrue(dataOut != null || ex.Message.Contains("No such host") || ex.Message.Contains("no data")); } finally { request.Dispose(); } }