none
webservice Missing Parameter Error Catch this Exception RRS feed

  • Question

  • Is it possible to catch InvalidOperation , Missing parameter error. 
    • Moved by Eason_H Wednesday, November 20, 2013 1:36 AM
    Friday, November 8, 2013 7:04 PM

Answers

All replies

  • I want to catch it and return a custom xml response for such error.
    Friday, November 8, 2013 7:05 PM
  • Hi Galaxya2009,

    C# provides built-in support for handling anomalous situations, known as exceptions, which may occur during the execution of your program. These exceptions are handled by code that is outside the normal flow of control.

    Here are some articles:

    http://msdn.microsoft.com/en-us/library/ms581654(v=office.14).aspx

    http://msdn.microsoft.com/en-us/library/ms173160.aspx

    http://csharp-station.com/Tutorial/CSharp/Lesson15

    I hope it can help you

    The following exception handling topics are explained in this section:


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    • Edited by Eason_H Monday, November 11, 2013 7:46 AM
    • Marked as answer by Eason_H Friday, November 15, 2013 1:58 AM
    Monday, November 11, 2013 7:44 AM
  • I have a general understanding of try-catch and exception handling , what I want in WCF RESTful webservice is to return an Error document in certain custom xml format. I used WebFaultException / FaultException, it throws error my custom xml but surrounds it by this,

    <Fault xmlns="http://schemas.microsoft.com/ws/2005/05/envelope/none">
    <Code>
    <Value>Receiver</Value>

    I want to get rid of this standard response .

    Friday, November 15, 2013 6:08 PM
  • Hi,

    This forum is to discuss problems of C# development.

    You'll need to post it in the dedicated WCF Forum http://social.msdn.microsoft.com/Forums/en-US/home?forum=wcf where you can contact WCF experts.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, November 20, 2013 1:36 AM