discretesoapexception.cs

来自「中文名:Windows Forms 程序设计 英文名:Windows Form」· CS 代码 · 共 44 行

CS
44
字号
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.Services.Protocols;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml;

// Avoid exposing implementation details in Release mode
public class DiscreteSoapException : SoapException {
  public DiscreteSoapException(string fault)
    :
      this(fault, "Server", "http://schemas.xmlsoap.org/soap/envelope/") {
  }

  public DiscreteSoapException(string fault, string faultCode)
    :
      this(fault, faultCode, "http://schemas.xmlsoap.org/soap/envelope/") {
  }

  public DiscreteSoapException(string fault, string faultCode, string faultNamespace)
    :
      base(fault, new XmlQualifiedName(faultCode, faultNamespace)) {
  }

  // Turn off the munging that SoapExpection does to expose implementation details
  // in the SOAP faultstring. That's great when we're in debug mode, but in release
  // mode, we shouldn't expose such details.
  // NOTE: We could also turn SoapExceptions faultstring munging off by turning
  // custom errors on in the web.config file:
  // <system.web><customErrors mode="On" /></system.web>
  public override string ToString() {
#if DEBUG
                return base.ToString();
#else
    return Message;
#endif
  }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?