views:

30

answers:

2

I need to return an error message to the client, if they have entered invalid data when calling my web service. So if my code is:

    If Not IsNumeric(strOrderID) Then
    Throw New SoapException("Invalid Order ID", SoapException.ClientFaultCode)
End If

I get a web page saying:
System.Web.Services.Protocols.SoapException: Invalid Order ID at Service.GetHeaderValues(String strOrderID)

Is there a way to display a more user friendly error message (such as a message box or just the words "Invalid Order ID")?

A: 

You'll need to catch the exception at the client and handle it appropriately (display message, log it, whatever).

The WebService would/could never "show" anything to the user itself.

drventure