Click here to Skip to main content
15,881,852 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
I am trying to transfer list of persons from wcf service to application. but when i bind image array with data then "maxReceivedMessageSize" issue raised. I have given multiple values but all in vain.

But actual problem is not only this because i have to transfer result of search of person and there can be multiple record set return. So i have to handle multiple Image array.

Solution required:

I want a proper way to transfer data from wcf service to application so that it can handle as many as possible Image arrays.

Thanks in advance.
Bilal Hassan
Posted
Comments
Kornfeld Eliyahu Peter 9-Dec-14 3:29am    
1. Increase maxReceivedMessageSize
2. Work with chunks...
bilal _hassan 9-Dec-14 4:42am    
Thanks Kornfeld Eliyahu Peter.\
tried to increase size to ="2147483647" but not working....
And i want permanent solution rather than increasing size.

If an image is a byte array
you could transfer an image collection as e.g. List<byte[]>

In the service contract interface of your WCF service
you could define a method e.g.
C#
[OperationContract]
List<byte[]> GetImages();


The implementation could be e.g.
C#
public List<byte[]> GetImages()
{
    List<byte[]> images = new List<byte[]>();

    images.Add(new byte[] { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 });
    images.Add(new byte[] { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 });
            
    return images;
}


This example uses dummy data,
it's up to you to add real data to the list.
 
Share this answer
 
Comments
bilal _hassan 9-Dec-14 5:52am    
Dear TheRealSteveJudge

I have tried to transfer List<t> but there are two issues.
1) Generic.List<t> do no publish to client. So it cant be accessible from client nor transferable directly.
2) I have used Dictionary<t> control but problem remains of Size Limit.
Anyway Thanks... :)
If You hav a large amaount of data to transfer via WCF, You should take a look at streaming:

Take a look at http://msdn.microsoft.com/en-us/library/ms751463%28v=vs.110%29.aspx[^]
 
Share this answer
 
Comments
bilal _hassan 9-Dec-14 5:53am    
Thanks Andy

I am just working on it. :)
You should check my answer on the next similar question:
How to transfer same class obj that was received from WCF service to Application C#[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900