Click here to Skip to main content
15,889,403 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi ,

I'm working on a task to handle synchronization between the client and server,client communicates with a REST endpoint . I got a problem in the following scenario ,

client has a large object(e.g. say 10 MB) to sync with server, so I have to serialize the object and then break it into two (e.g say 5 MB). so now i can send the first part as a post and then the second part, but my problem is since these two parts are just two separate requests for REST, they cannot be combined at the server. I really appreciate if anyone can give a clue how to handle this. OR really is this possible ?

thanks in advance .:)
Posted

I think the way to handle this is to split the object into several smaller parts. In each part, give the object an item number (common to each part of the object) a part number (unique) and a total parts (common).

On the receiver as the parts are received, store them until all the parts are received. Once the last one has been received re-assemble to re-construct the original object.
 
Share this answer
 
Comments
prasadbuddhika 28-Oct-12 3:51am    
yes , thanks for your suggestion , But the problem is the server has implemented this REST endpoint using WCF and it process the each request in separate threads.please correct me if I'm wrong , if I'm correct then my problem is there , means I cannot get the first part and second part since they are in two threads right ?
Make your REST service asynchronous, and at client call it asynchronously and implement a call back function.
Helpful links for you.
http://msdn.microsoft.com/en-us/library/ms731177.aspx[^]

http://msdn.microsoft.com/en-us/library/ms730059.aspx[^]
 
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