Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / FaultCode.cs / 1 / FaultCode.cs
//------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace System.ServiceModel { using System.Xml; using System.ServiceModel; using System.ServiceModel.Description; using System.Xml.Schema; using System.Xml.Serialization; using System.Runtime.Serialization; public class FaultCode { FaultCode subCode; string name; string ns; EnvelopeVersion version; public FaultCode(string name) : this(name, "", null) { } public FaultCode(string name, FaultCode subCode) : this(name, "", subCode) { } public FaultCode(string name, string ns) : this(name, ns, null) { } public FaultCode(string name, string ns, FaultCode subCode) { if (name == null) throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("name")); if (name.Length == 0) throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("name")); if (!string.IsNullOrEmpty(ns)) NamingHelper.CheckUriParameter(ns, "ns"); this.name = name; this.ns = ns; this.subCode = subCode; if (ns == Message12Strings.Namespace) this.version = EnvelopeVersion.Soap12; else if (ns == Message11Strings.Namespace) this.version = EnvelopeVersion.Soap11; else if (ns == MessageStrings.Namespace) this.version = EnvelopeVersion.None; else this.version = null; } public bool IsPredefinedFault { get { return ns.Length == 0 || version != null; } } public bool IsSenderFault { get { if (IsPredefinedFault) return name == (this.version ?? EnvelopeVersion.Soap12).SenderFaultName; return false; } } public bool IsReceiverFault { get { if (IsPredefinedFault) return name == (this.version ?? EnvelopeVersion.Soap12).ReceiverFaultName; return false; } } public string Namespace { get { return ns; } } public string Name { get { return name; } } public FaultCode SubCode { get { return subCode; } } public static FaultCode CreateSenderFaultCode(FaultCode subCode) { return new FaultCode("Sender", subCode); } public static FaultCode CreateSenderFaultCode(string name, string ns) { return CreateSenderFaultCode(new FaultCode(name, ns)); } public static FaultCode CreateReceiverFaultCode(FaultCode subCode) { if (subCode == null) throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("subCode")); return new FaultCode("Receiver", subCode); } public static FaultCode CreateReceiverFaultCode(string name, string ns) { return CreateReceiverFaultCode(new FaultCode(name, ns)); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- UnicodeEncoding.cs
- DataBindingCollection.cs
- ParseChildrenAsPropertiesAttribute.cs
- WSSecurityPolicy11.cs
- __FastResourceComparer.cs
- ADRoleFactoryConfiguration.cs
- TabControlEvent.cs
- ParagraphResult.cs
- XsltFunctions.cs
- StringTraceRecord.cs
- EntityDesignerUtils.cs
- EditorZoneBase.cs
- DesignRelation.cs
- StringBlob.cs
- CodeDomDesignerLoader.cs
- FieldTemplateFactory.cs
- DataGridToolTip.cs
- parserscommon.cs
- ObjectListField.cs
- EntryWrittenEventArgs.cs
- CompilationUnit.cs
- IPCCacheManager.cs
- LocatorBase.cs
- SafeFileHandle.cs
- clipboard.cs
- DBSqlParserColumn.cs
- ScriptResourceDefinition.cs
- X500Name.cs
- RemoteWebConfigurationHostStream.cs
- TransformerConfigurationWizardBase.cs
- MasterPage.cs
- BrowserCapabilitiesCodeGenerator.cs
- MarshalDirectiveException.cs
- RegexCompiler.cs
- RadioButtonRenderer.cs
- WebServiceEnumData.cs
- BindingExpressionUncommonField.cs
- ModelItemCollectionImpl.cs
- EmptyEnumerator.cs
- ClientBuildManager.cs
- FlowLayout.cs
- UidManager.cs
- ReferenceEqualityComparer.cs
- InstalledVoice.cs
- OleDbParameterCollection.cs
- DbConnectionHelper.cs
- EncryptedReference.cs
- GeneralTransform3DGroup.cs
- CompareInfo.cs
- DefaultAssemblyResolver.cs
- ComPlusThreadInitializer.cs
- JsonFaultDetail.cs
- TransactionContext.cs
- XmlWellformedWriter.cs
- WizardStepBase.cs
- ParameterInfo.cs
- SelectionPattern.cs
- StringFreezingAttribute.cs
- WinFormsUtils.cs
- TaskFileService.cs
- CultureSpecificStringDictionary.cs
- WindowsScrollBarBits.cs
- ObjectParameter.cs
- SchemaTypeEmitter.cs
- AdapterUtil.cs
- MeshGeometry3D.cs
- Hex.cs
- MetabaseServerConfig.cs
- InputScopeAttribute.cs
- Identifier.cs
- ArrayHelper.cs
- Setter.cs
- listitem.cs
- BufferedGraphics.cs
- OpenFileDialog.cs
- ByteArrayHelperWithString.cs
- WorkflowDefinitionContext.cs
- SafeProcessHandle.cs
- TreeViewHitTestInfo.cs
- ControlBindingsCollection.cs
- CodeAttributeDeclarationCollection.cs
- ThaiBuddhistCalendar.cs
- SQlBooleanStorage.cs
- BrowserDefinition.cs
- XmlILConstructAnalyzer.cs
- WeakReference.cs
- TypeDescriptor.cs
- SQLSingle.cs
- CheckBoxStandardAdapter.cs
- WorkflowInstanceContextProvider.cs
- GB18030Encoding.cs
- WebEventCodes.cs
- SqlClientWrapperSmiStreamChars.cs
- SHA384.cs
- SmiGettersStream.cs
- EmulateRecognizeCompletedEventArgs.cs
- AddInBase.cs
- GridView.cs
- SinglePageViewer.cs
- FontWeightConverter.cs