I want to post very large data to server. For this I am following the below steps:
1). First read local database and convert into XML string.
2). Then pass variable to WCF service using post method
Previously I was doing this using get method and bind the XML string to URL as query-sting. But as my data was very large , I was getting Long URL Issue. Thats why changed my procedure to post.
By post method is not working..
Please find below the basic demo I am using to make the WCF service and calling it using post method. Kindly do modification if required.
WCF Service:
[OperationContract] [WebInvoke(Method = "POST", ResponseFormat = WebMessageFormat.Json, RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped, UriTemplate = "LTSCheck")] Checklts[] LTSCheck(string p1, string p2); [DataContract] public class Checklts { [DataMember(Name = "msg")] public string msg { get; set; } [DataMember(Name = "exception")] public string exception { get; set; } } public Checklts[] LTSCheck(string p1, string p2) { List<Checklts> objpqs = new List<Checklts>(); Checklts checklttds = new Checklts(); try { checklttds.msg = "Valus of P1 is :" + p1 + " and Values of P2 is " + p2; } catch (Exception ex) { checklttds.msg = "0"; checklttds.exception = ex.Message; } finally { objpqs.Add(checklttds); } return objpqs.ToArray(); }
Rainer Jeschor Sir , Originally I am saving data in local database where I have approx. 50 columns and any number of rows (depeds user input). I want to copy all rows / Local database and save/ Syncornize it to Server Database.
Bytech India
ASKER
Aikimark Sir, Can you please explain in brief.
Bytech India
ASKER
Aikimark Sir, sure . From next time i'll follow that.