Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / clr / src / BCL / System / Runtime / Serialization / Formatters / SoapFault.cs / 1 / 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
**
===========================================================*/
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;
}
}
[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;
//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;}
}
}
}
// 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
**
===========================================================*/
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;
}
}
[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;
//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;}
}
}
}
// 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
- InstanceView.cs
- XPathMessageFilter.cs
- CachedFontFamily.cs
- SimpleType.cs
- OuterGlowBitmapEffect.cs
- _ProxyChain.cs
- WebPartEditVerb.cs
- ShaderEffect.cs
- WorkflowInstanceAbortedRecord.cs
- EdmValidator.cs
- AmbientEnvironment.cs
- StateMachineSubscriptionManager.cs
- EndpointConfigContainer.cs
- TCEAdapterGenerator.cs
- AudioDeviceOut.cs
- MetadataCacheItem.cs
- MeshGeometry3D.cs
- XmlComment.cs
- SortFieldComparer.cs
- Keywords.cs
- ReferentialConstraint.cs
- IgnoreDeviceFilterElementCollection.cs
- DbRetry.cs
- SimpleBitVector32.cs
- MobileDeviceCapabilitiesSectionHandler.cs
- CLRBindingWorker.cs
- PropertyNames.cs
- DataGridDetailsPresenter.cs
- ParserOptions.cs
- SizeConverter.cs
- PropertyMapper.cs
- Animatable.cs
- InputGestureCollection.cs
- ConsumerConnectionPointCollection.cs
- CodePageUtils.cs
- SerializationInfo.cs
- MailBnfHelper.cs
- SiteMap.cs
- SByte.cs
- PackageRelationship.cs
- ConstantProjectedSlot.cs
- PrintingPermission.cs
- EntityDataSourceMemberPath.cs
- ThicknessConverter.cs
- DataGridViewCheckBoxColumn.cs
- SortedDictionary.cs
- MultiplexingFormatMapping.cs
- Wizard.cs
- DeclaredTypeValidator.cs
- NetCodeGroup.cs
- FlowLayout.cs
- ObjectItemNoOpAssemblyLoader.cs
- OperationContext.cs
- FilterQuery.cs
- PropertyGridCommands.cs
- SqlDataSourceEnumerator.cs
- HttpWebRequest.cs
- oledbconnectionstring.cs
- ColumnReorderedEventArgs.cs
- SerializationInfo.cs
- TemplateInstanceAttribute.cs
- DataGridViewCellLinkedList.cs
- BaseUriHelper.cs
- SqlConnection.cs
- MyContact.cs
- StandardCommands.cs
- AssociationEndMember.cs
- Completion.cs
- SafeLocalMemHandle.cs
- TimelineClockCollection.cs
- MembershipValidatePasswordEventArgs.cs
- StringUtil.cs
- ActivityTypeDesigner.xaml.cs
- CapabilitiesAssignment.cs
- SqlLiftWhereClauses.cs
- VirtualPathProvider.cs
- XmlObjectSerializerReadContextComplexJson.cs
- DebuggerService.cs
- Hex.cs
- TraceEventCache.cs
- Normalizer.cs
- HttpDebugHandler.cs
- Visual3D.cs
- MouseOverProperty.cs
- SignerInfo.cs
- ExpandCollapseProviderWrapper.cs
- EntityTransaction.cs
- DataGridCellEditEndingEventArgs.cs
- FrameDimension.cs
- WMIGenerator.cs
- EnumBuilder.cs
- PeerNearMe.cs
- InputMethodStateTypeInfo.cs
- WebPageTraceListener.cs
- PenThreadPool.cs
- DataGridViewColumnEventArgs.cs
- ChtmlImageAdapter.cs
- PageThemeBuildProvider.cs
- FrugalMap.cs
- TextUtf8RawTextWriter.cs