i created a wcf web service. my service uses EF5 data acceess to fetch data.
i have only one function named GetAllAdminList() code: IAdminService.cs
public interface IAdminService
{
[OperationContract]
List<TblAdmin> GetAllAdminList();
}
And AdminService.svc.cs
public class AdminService : IAdminService
{
public List<TblAdmin> GetAllAdminList()
{
AdminJobBal adminBal = new AdminJobBal();
return adminBal.GetAllAdminList();
}
}
Here the code part is returning the listofAdminUser from database.
Now When i am invoking the service on setting service as startup project and AdminService.svc.cs as startup page it throws me a error
An error occurred while receiving the HTTP response to "localhost:13001/AdminService/AdminService.svc" This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). See server logs for more details.
i can assure u that my data access code works,bcoz i dubug that project and i saw that it return the List perfectly! the problem occures AFTER the return value of List
to check And also i have an another svc that
public class Service1 : IService1
{
public string GetName(string Name)
{
return "hello" + Name;
}
}
when i make it startuppage it's invoking fine and returning the string.
Don't know what is the main problem,please help me to resolve it.
the web config file is
<configuration>
<connectionStrings>
<add name="ParasharPortalEntities" connectionString="metadata=res://*/CommonEntity.ParasharPortal.csdl|res://*/CommonEntity.ParasharPortal.ssdl|res://*/CommonEntity.ParasharPortal.msl;provider=System.Data.SqlClient;provider connection string="data source=AMIT-PC;initial catalog=ParasharPortal-1.0;user id=sa;password=samsung;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
</connectionStrings>
<appSettings>
<add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5"/>
</system.web>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior>
<!--
<serviceMetadata httpGetEnabled="true"/>
<!--
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<protocolMapping>
<add binding="basicHttpsBinding" scheme="https" />
</protocolMapping>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
<!--
<directoryBrowse enabled="true"/>
</system.webServer>
</configuration>
and the TblAdmin Entities is like This
public class TblAdmin
{
public TblAdmin();
public int AdminId { get; set; }
public string AdminName { get; set; }
public string AdminPassword { get; set; }
public string AdminUserName { get; set; }
public string ContactNumber { get; set; }
public DateTime CreatedOn { get; set; }
public string Description { get; set; }
public bool IsActive { get; set; }
public bool IsDeleted { get; set; }
public virtual ICollection<TblCity> TblCities { get; set; }
public virtual ICollection<TblCompany> TblCompanies { get; set; }
public virtual ICollection<TblCountry> TblCountries { get; set; }
public virtual ICollection<TblJob> TblJobs { get; set; }
public virtual ICollection<TblJobType> TblJobTypes { get; set; }
public virtual ICollection<TblSkillGroup> TblSkillGroups { get; set; }
public virtual ICollection<TblSkill> TblSkills { get; set; }
public virtual ICollection<TblState> TblStates { get; set; }
}