I'm experiencing a weird problem with one of methods of my wcf
service. I have a generic response model, which is working fine for all other services. but for one case, it has a problem. My model is something like:
public class ResponseModel
{
dynamic Model { get; set; }
bool success { get; set; }
string Message { get; set; }
}
I have a method called LoadUsers
. If users are found, i populate a list, create a new ResponseModel
object, and assign list to Model
property. like,
List<UserModel> usersList = GetUsersList(ids);
ResponseModel response = new ResponseModel();
response.Model = usersList;
response.success = true;
return response;
All the logic is executed fine. But i get no response at all. I checked, response
is populated fine till the end using breakpoint, but still no response.
Thing that's weird to me is, when usersList
is null
, which means Model
property of the response
is null
, it works fine. i get response.
& secondly, it is my generic model, and working fine for all other methods.
I can't figure out the possible reason. Checked out several related questions at SO, but most of them were related to size issues, etc.
services are created for Android devices, and return Json
. like:
[OperationContract]
[WebGet(UriTemplate = "LoadUsersList?Key={Key}", ResponseFormat = WebMessageFormat.Json)]
ResponseModel LoadUsersList(string Key);
Rest of the services are being consumed successfully. Kindly help/suggest me to figure out the reason.