Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / clr / src / BCL / System / Runtime / Serialization / Formatters / SoapFault.cs / 1305376 / SoapFault.cs
// ==++==
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
/*============================================================
**
** Class: SoapFault
**
** Author: Peter de Jong ([....])
**
** Purpose: Specifies information for a Soap Fault
**
** Date: June 27, 2000
**
===========================================================*/
#if FEATURE_REMOTING
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;
//* Class holds soap fault information
[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;
}
}
[System.Security.SecurityCritical] // auto-generated_required
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;
//this.exceptionType = exception.GetType().AssemblyQualifiedName;
//this.message = exception.Message;
}
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;}
}
}
}
#endif // FEATURE_REMOTING
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// ==++==
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
/*============================================================
**
** Class: SoapFault
**
** Author: Peter de Jong ([....])
**
** Purpose: Specifies information for a Soap Fault
**
** Date: June 27, 2000
**
===========================================================*/
#if FEATURE_REMOTING
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;
//* Class holds soap fault information
[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;
}
}
[System.Security.SecurityCritical] // auto-generated_required
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;
//this.exceptionType = exception.GetType().AssemblyQualifiedName;
//this.message = exception.Message;
}
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;}
}
}
}
#endif // FEATURE_REMOTING
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- CompilationSection.cs
- CachedFontFamily.cs
- ImageSource.cs
- PointUtil.cs
- SchemaComplexType.cs
- EventLogPermissionEntry.cs
- CommandValueSerializer.cs
- RegisteredDisposeScript.cs
- XmlC14NWriter.cs
- FontFamily.cs
- StringConverter.cs
- ClassImporter.cs
- RunClient.cs
- DispatcherFrame.cs
- TaskDesigner.cs
- DataSourceControlBuilder.cs
- LinqTreeNodeEvaluator.cs
- HttpResponse.cs
- HandlerMappingMemo.cs
- TreeView.cs
- AccessDataSource.cs
- FormsAuthenticationUser.cs
- Material.cs
- SqlCommandAsyncResult.cs
- IsolatedStorage.cs
- StrokeNodeEnumerator.cs
- ImageClickEventArgs.cs
- SqlFileStream.cs
- InputProcessorProfilesLoader.cs
- WebBaseEventKeyComparer.cs
- MdbDataFileEditor.cs
- Annotation.cs
- XmlBindingWorker.cs
- EntityDataSourceContainerNameConverter.cs
- ProviderUtil.cs
- CompilerTypeWithParams.cs
- HostingEnvironmentException.cs
- SystemEvents.cs
- WebBrowsableAttribute.cs
- WebPartConnectionsEventArgs.cs
- BadImageFormatException.cs
- ScalarType.cs
- ColorTranslator.cs
- CompModSwitches.cs
- AssociatedControlConverter.cs
- RoleService.cs
- WhiteSpaceTrimStringConverter.cs
- InternalTransaction.cs
- JpegBitmapDecoder.cs
- ListViewInsertionMark.cs
- parserscommon.cs
- Rfc2898DeriveBytes.cs
- HandledEventArgs.cs
- FileDialogCustomPlacesCollection.cs
- DataGridViewRowStateChangedEventArgs.cs
- x509store.cs
- ProfilePropertyNameValidator.cs
- ThreadStartException.cs
- XsltContext.cs
- XPathNodePointer.cs
- PlatformCulture.cs
- UdpTransportSettingsElement.cs
- PrimitiveXmlSerializers.cs
- CodeDomSerializationProvider.cs
- ProxyAttribute.cs
- TextBox.cs
- NameTable.cs
- PlatformCulture.cs
- LiteralText.cs
- Win32KeyboardDevice.cs
- EntityDataSourceContextCreatingEventArgs.cs
- NumericUpDownAccelerationCollection.cs
- ReadOnlyMetadataCollection.cs
- UIElementCollection.cs
- XAMLParseException.cs
- InputScope.cs
- DebugViewWriter.cs
- XmlWrappingWriter.cs
- OutOfMemoryException.cs
- DataGridViewMethods.cs
- DataServiceRequest.cs
- TcpWorkerProcess.cs
- SizeAnimationClockResource.cs
- MutableAssemblyCacheEntry.cs
- BulletedListDesigner.cs
- BadImageFormatException.cs
- GZipStream.cs
- BinaryConverter.cs
- SoapReflectionImporter.cs
- DataServiceKeyAttribute.cs
- SmiEventSink_DeferedProcessing.cs
- ErrorWebPart.cs
- HostSecurityManager.cs
- ZipIORawDataFileBlock.cs
- DetailsViewUpdateEventArgs.cs
- InvalidDataException.cs
- ICollection.cs
- DesignerAdapterUtil.cs
- VSDExceptions.cs
- RequiredFieldValidator.cs