I have developed WCF service for my one of the desktop application and host into Azure server with DB.
I have just connect WCF service Url on my local Desktop application.
Once i called login method from application. then no issue.
Once i called my second method then always i got FaultException error
Error is like that see the inner exception for detail error. but once i go inside then inner exception is null.
I also put <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
into my wcf web.config
Once i connect local WCF with live db with my desktop app then everything is work fine.
Once i connect Live WCF with live db with my desktop app then not working insert and update data.
my second method having this code.
public class Service1 : IService1
{
public void method1(int nm_Id, string f_LoginStatus)
{
class1 lo_class = new class1();
DateTime dt = DateTime.UtcNow;
//check records exist or not
lo_class.dt_date = dt;
lo_class.dtCreatedOn = dt;
lo_tblAttendance.dtUpdatedOn = dt;
_context.tblAttendances.Add(lo_tblAttendance);
Save();
}
}
}
[ServiceContract]
public interface IService1
{
[OperationContract]
[FaultContract(typeof(InitializationFault))]
void method1(int nm_Id, string f_LoginStatus);
}
[DataContract]
public class InitializationFault
{
public InitializationFault(Exception exc, string msg)
{
Exception = exc;
Message = msg;
}
[DataMember]
public Exception Exception { get; set; }
[DataMember]
public string Message { get; set; }
}
Calling above method from desktop app:
lo_loginServices = new MyService.Service1Client();
try
{
lo_loginServices.method1(lo_EmpId, "In"); // getting inner exception error here
}
catch (FaultException<InitializationFault> ex)
{
Console.WriteLine("FaultException<InitializationFault>: " + ex.Detail);
//more
}
I've write catch section then also i can't able to see actual error.