Hi,
I have services on both ends. A service is passing large byte array to another service. But failing.
I have configured both services for large data. But I am getting Out of memory exception when calling the following code.
var data = JsonConvert.SerializeObject(bytes); // bytes is byte array of file approx size of 50mb.
//Create method Uri
var uri = new Uri(url);
using (HttpClient client = new HttpClient())
{
client.BaseAddress = new Uri(Utility.ServiceBaseUri);
client.DefaultRequestHeaders.Accept.Clear();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
client.Timeout = new TimeSpan(0, 10, 0);
HttpResponseMessage response = client.PostAsJsonAsync(uri.ToString(), data).Result; //Exception Out of memory....
if (response.IsSuccessStatusCode)
{
}
}
Loading
mursaleenfayyaz fayyazuddinPosted Apr 7, 2015, 7:31 AM
Abhishek KumarPosted Apr 7, 2015, 6:48 AM
Hi,
Please check the machine where service is built and deployed.
With 64 bits machine there should not be any problem with memory limit.
Abhishek
mursaleenfayyaz fayyazuddinPosted Apr 7, 2015, 6:27 AM
but not able to send.
file attached.
Abhishek KumarPosted Apr 7, 2015, 6:22 AM
If you could try the below.