Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / 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;} } } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- TagPrefixCollection.cs
- RadioButtonList.cs
- RemoteWebConfigurationHostStream.cs
- SocketManager.cs
- ToolStripKeyboardHandlingService.cs
- DataGridViewCheckBoxColumn.cs
- ProfileSection.cs
- TypeConstant.cs
- BaseUriHelper.cs
- RepeatInfo.cs
- ToolboxItemCollection.cs
- ScalarConstant.cs
- SQLBoolean.cs
- DataGridDefaultColumnWidthTypeConverter.cs
- TreeView.cs
- PrivilegeNotHeldException.cs
- HMACRIPEMD160.cs
- XmlILIndex.cs
- SizeIndependentAnimationStorage.cs
- TextEditorSelection.cs
- OverrideMode.cs
- TypeDescriptionProvider.cs
- GrammarBuilder.cs
- SamlAuthenticationClaimResource.cs
- TrustManagerPromptUI.cs
- X509SecurityTokenAuthenticator.cs
- LoadItemsEventArgs.cs
- APCustomTypeDescriptor.cs
- TemplateControl.cs
- FrameworkReadOnlyPropertyMetadata.cs
- RemoteCryptoRsaServiceProvider.cs
- COAUTHINFO.cs
- WmlPanelAdapter.cs
- ResourcePart.cs
- X509Certificate.cs
- CompositeCollection.cs
- ObjectSpanRewriter.cs
- ActivityTrace.cs
- ReadWriteSpinLock.cs
- DescendantQuery.cs
- Pts.cs
- EncryptedXml.cs
- SmiEventSink_DeferedProcessing.cs
- ReachVisualSerializer.cs
- DataGridViewTopLeftHeaderCell.cs
- SigningProgress.cs
- DataGridAutomationPeer.cs
- OperationInfoBase.cs
- CacheRequest.cs
- ProgressBarBrushConverter.cs
- SQLCharsStorage.cs
- CompilerGlobalScopeAttribute.cs
- TabItemWrapperAutomationPeer.cs
- WebRequestModuleElement.cs
- Int64Animation.cs
- ConditionalAttribute.cs
- PropertyIDSet.cs
- XhtmlBasicObjectListAdapter.cs
- PropertyToken.cs
- SiteIdentityPermission.cs
- ComboBox.cs
- TypeToken.cs
- ServiceHttpModule.cs
- _ConnectionGroup.cs
- ProcessModelInfo.cs
- FactoryGenerator.cs
- NamespaceCollection.cs
- DataGridViewAutoSizeColumnsModeEventArgs.cs
- PrefixQName.cs
- PerformanceCounterCategory.cs
- CustomErrorCollection.cs
- TracingConnectionListener.cs
- WMIInterop.cs
- CodeSnippetTypeMember.cs
- MimeMapping.cs
- XmlObjectSerializerWriteContextComplex.cs
- SubMenuStyleCollection.cs
- WebBrowserBase.cs
- XmlAggregates.cs
- CfgRule.cs
- XmlValidatingReader.cs
- Vector3DAnimationUsingKeyFrames.cs
- PictureBox.cs
- TreeNodeMouseHoverEvent.cs
- ConfigsHelper.cs
- RedistVersionInfo.cs
- ConfigurationConverterBase.cs
- RadioButtonList.cs
- XPathAncestorQuery.cs
- SessionIDManager.cs
- AnimatedTypeHelpers.cs
- PassportPrincipal.cs
- ObjectList.cs
- FactoryRecord.cs
- UseLicense.cs
- ValueQuery.cs
- ChannelTraceRecord.cs
- ConfigXmlAttribute.cs
- PrimitiveType.cs
- StaticResourceExtension.cs