SoapException.Message on the Client
Posted by: Rick Strahls WebLog,
on 11 Aug 2006 |
View original
I hate the way SoapExceptions return messages to the client. So, assume you have a server side WebMethod that throws a SoapException like this:
[WebMethod(Description="Returns messages using XML entity body content")]
public XmlNode GetMessagesXml(string Password)
{
string PartnerId = this.GetPartnerIdFromPath();
if (string.IsNullOrEmpty(PartnerId))
throw new SoapException("Invalid Partner Id", SoapException.ServerFaultCode);
// ***...