TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
mursaleenfayyaz fayyazuddin
NA
34
3.8k
How to upload large byte array on server by WCF service?
Apr 7 2015 6:08 AM
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)
{
}
}
Reply
Answers (
4
)
Failed to add a service. Service metadata may not be accessi
ERROR_NOT_FOUND: Error with Credential Manager API