I have WCF service in which I want raise an Exception, when I am raising an exception then I getting Error Exception unhandled by user code. Please someone can figure this Issue. My Interface is as follows:
[ServiceContract]
public interface IADSICAuthentication
{
[WebInvoke(Method = "POST", UriTemplate = "Login", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
[OperationContract]
Response LoginClient(Credentials credentials);
}
and my LoginCLient Method defines below
public Response LoginClient(Credentials oCredentials)
{
try
{
if(oCredentials.PassWord == null)
{
//something
}
else
{
throw new Exception(string.Format("UnAuthorize User : 401"));
}
}
catch (Exception e)
{
throw; // I am getting Exception here Unhandled by user code
}
}