JSOn object not deserializing properly in wcf webservice side

Viewed 365

I am working on iOS project and sending the Json string to backend through wcf webservice, Its working successfully for many users but for some users backend getting incomplete json string.

Code for generating Json string

NSData *data = [NSJSONSerialization dataWithJSONObject:EmployeeDetails options:0 error:nil];
    NSString *JsonString = [[NSString alloc] initWithData:data
                                                 encoding:NSUTF8StringEncoding];

And Attaching the json string with request by below code

[request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
[request setHTTPBody:[jsonString dataUsingEncoding:NSUTF8StringEncoding]];

EmployeeDetails is NSMutableDictionary with employee details.

And

Here is successful Json string deserialized from BackEnd

{"FirstName":"Donald","LastCBPaymentType":6,"AcceptEmail":true,"CellPhone":"321-300-6874","Position":"3","CarrierNum":"4","EmpNum":"96874"}

And Incomplete Json string

{"FirstName":"roset","LastCBPaymentType":6,"AcceptEmail":true,"CellPhone":"321-300-6874","Position":"3","CarrierNum":"4","EmpNum":"98799

The incomplete json string occuring in backend for some user.

Any one can help to solve this issue ?

2 Answers
Related