My WCF service is hosted on local IIS. I could not get the result from the wcf call when I call it from the application. But it is strange that it is showing correct result in debugging(while step into the service classes) and returning array of object in the staging classes. and when debugging comes to the application it returns empty array. I have below call from application.
public List<SurveyQuestion> GetCommonQuestionsForCompentency()
{
List<SurveyQuestion> questions = new List<SurveyQuestion>();
SurveyQuestion[] ques = null;
ICSSService.SurveyServiceClient client = null;
try
{
client = (SurveyServiceClient)WCFSecurityEntityForSurvey.getSurveyClient();
ques = client.GetCommonQuestionsByCategoryType(2);
questions = ques.ToList<SurveyQuestion>();
return questions;
}
catch (Exception)
{
throw;
}
finally{ client.Close();}
}
Call in the wcf service class shown below
Whats going wrong with the implementation. Any help?
EDIT :
It is working for a simple service call without list. I think the problem may be in the returning of collection. I found the similar questions Here. But did not get much from this.
I have similar problem with this.This is because References are not added correctly and I modified reference.cs file. So data is not gaining correctly if namespaces are different in the application. Just check the namespaces in your application. See if one of the class in your application have different namespace than others