none
Custom FaultExcetion to SOAP format in WCF RRS feed

  • Question

  • Hello,

    I have custom Message contract and want to convert to SOAP on client side. Here is my message contract.

    public string GetData(int value)
            {
                int a = 1;
                int b = 0;
                try
                {
                    return (a/b).ToString();
                }
               
                    catch (Exception ex)
                    {
                        throw new FaultException<ABCSTransactions>(new ABCTransactions { Amount = 10000.50, accountNumber = "AC98765}, new FaultReason("An error occurred during a WCF call, see inner Detail for more info! ---" + ex.ToString()));
                    }
            }

    [MessageContract]
        public class ABCTransactions
        {
            [MessageHeader]
            public string  accountNumber;
            [MessageHeader]
            public double Amount;

        }

    Client side code:

     catch (FaultException<ABCTransactions> abctran)
                    {

                 // How to get SOAP format

                    }

    Sunday, March 3, 2013 2:43 AM

Answers