How to handle Fault in WCF Service Call RRS feed

  • Question

  • User236231 posted

    Hi I am calling WCF service but exception is not handled by FaultException and its giving below exception details. Can anyone please help me on this?

    "Error in line 1 position 197. Expecting element 'ExceptionDetail' from namespace 'http://schemas.datacontract.org/2004/07/System.ServiceModel'.. Encountered 'Element' with name 'UnityFault', namespace 'http://schemas.datacontract.org/2004/07/Allscripts.Unity.Services.ObjectDeclarations.Unity'."

     MagicRequest req = new MagicRequest( Parameter1, Parameter2, Parameter3, Parameter4, Parameter5, Parameter6);
                MagicResponse res = new MagicResponse();
                    res =
                          (asyncCallback, asyncState) =>
                              _client.BeginMagic(req, asyncCallback, asyncState),
                          (asyncResult) =>
                catch (FaultException<UnityFault> ex)
                    //Exception is not coming here.
                catch (Exception ex)
                    System.Diagnostics.Debug.WriteLine("Error :" + ex.ToString());
                return res;
    Monday, August 1, 2016 12:58 PM

All replies

  • User236231 posted

    Can anyone please help me on this ?

    Tuesday, August 2, 2016 9:09 AM