Click here to Skip to main content
15,891,316 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am working on MVC 4 and WCF Class Library I had added method that is return List<class> and I have added reference of WCF services.
now I am creating proxy of ServiceReference1 then I am not able to get this ServiceReference1 object.
if I changed return type to string then it working..

I had tried changing all collection type but I dint get ServiceReference1 object.!

where I am wrong or what is the solution.?

My WCF code is here

public class BuildTrackerService : IBuildTrackerService
{
public List<property> DoWork()
{
DataTable dt = new DataTable();
List<property> objProperty = new List<property>();
SqlConnection conn = DbConnection.GetConnection();
SqlDataAdapter adpt = new SqlDataAdapter("[GetPropertyDetail]", conn);
adpt.SelectCommand.CommandType = CommandType.StoredProcedure;
try
{
conn.Open();
adpt.Fill(dt);
}
catch (Exception) { throw; }
finally
{
conn.Close();
adpt.Dispose();
}
objProperty = DataTableHelper.ConvertTo<property>(dt);
return objProperty;
}
}


MY MVC 4 ActionResult is like

public ActionResult Index()
{
ViewBag.Message = "Modify this template to jump-start your ASP.NET MVC application.";
//==> this ServiceReference1 is not accessible here....!ServiceReference1.BuildTrackerServiceClient obj = new ServiceReference1.BuildTrackerServiceClient();
var objct = obj.DoWork();
return View();
}


I had tried with !

[1]: http://i.stack.imgur.com/yQYyv.png
Posted
Updated 28-May-13 20:35pm
v3
Comments
Jameel VM 28-May-13 23:34pm    
Please post the service code
Jitendra.Jadav 29-May-13 2:33am    
Hi Jameel I had updated with code and image..
What did you select from that Collection Type dropdown ?
Jitendra.Jadav 4-Jun-13 8:42am    
I was trying with different option but none of to resolved my problem..

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