We need you! We're working hard on the next version of Developer Fusion -
Let us know what you think we should be up to!
- namespace System.Runtime.Serialization.Formatters
- {
- using System;
- using System.Runtime.Serialization;
- using System.Runtime.Remoting;
- using System.Runtime.Remoting.Metadata;
- using System.Globalization;
- using System.Security.Permissions;
-
-
-
- [Serializable(), SoapType(Embedded = true)]
- [System.Runtime.InteropServices.ComVisible(true)]
- public sealed class SoapFault : ISerializable
- {
- string faultCode;
- string faultString;
- string faultActor;
- [SoapField(Embedded = true)]
- object detail;
-
- public SoapFault()
- {
- }
-
- public SoapFault(string faultCode, string faultString, string faultActor, ServerFault serverFault)
- {
- this.faultCode = faultCode;
- this.faultString = faultString;
- this.faultActor = faultActor;
- this.detail = serverFault;
- }
-
- internal SoapFault(SerializationInfo info, StreamingContext context)
- {
- SerializationInfoEnumerator siEnum = info.GetEnumerator();
-
- while (siEnum.MoveNext()) {
- string name = siEnum.Name;
- object value = siEnum.Value;
- SerTrace.Log(this, "SetObjectData enum ", name, " value ", value);
- if (String.Compare(name, "faultCode", true, CultureInfo.InvariantCulture) == 0) {
- int index = ((string)value).IndexOf(':');
- if (index > -1)
- faultCode = ((string)value).Substring(++index);
- else
- faultCode = (string)value;
- }
- else if (String.Compare(name, "faultString", true, CultureInfo.InvariantCulture) == 0)
- faultString = (string)value;
- else if (String.Compare(name, "faultActor", true, CultureInfo.InvariantCulture) == 0)
- faultActor = (string)value;
- else if (String.Compare(name, "detail", true, CultureInfo.InvariantCulture) == 0)
- detail = value;
- }
- }
-
- [SecurityPermissionAttribute(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.SerializationFormatter)]
- public void GetObjectData(SerializationInfo info, StreamingContext context)
- {
- info.AddValue("faultcode", "SOAP-ENV:" + faultCode);
- info.AddValue("faultstring", faultString);
- if (faultActor != null)
- info.AddValue("faultactor", faultActor);
- info.AddValue("detail", detail, typeof(object));
- }
-
- public string FaultCode {
- get { return faultCode; }
- set { faultCode = value; }
- }
-
- public string FaultString {
- get { return faultString; }
- set { faultString = value; }
- }
-
-
- public string FaultActor {
- get { return faultActor; }
- set { faultActor = value; }
- }
-
-
- public object Detail {
- get { return detail; }
- set { detail = value; }
- }
- }
-
- [Serializable(), SoapType(Embedded = true)]
- [System.Runtime.InteropServices.ComVisible(true)]
- public sealed class ServerFault
- {
- string exceptionType;
- string message;
- string stackTrace;
- Exception exception;
-
- internal ServerFault(Exception exception)
- {
- this.exception = exception;
-
-
- }
-
- public ServerFault(string exceptionType, string message, string stackTrace)
- {
- this.exceptionType = exceptionType;
- this.message = message;
- this.stackTrace = stackTrace;
- }
-
-
- public string ExceptionType {
- get { return exceptionType; }
- set { exceptionType = value; }
- }
-
- public string ExceptionMessage {
- get { return message; }
- set { message = value; }
- }
-
-
- public string StackTrace {
- get { return stackTrace; }
- set { stackTrace = value; }
- }
-
- internal Exception Exception {
- get { return exception; }
- }
- }
- }