System\ServiceModel\Channels\MessageFault.cs (33)
73EnvelopeVersion envelopeVersion = message.Version.Envelope;
75if (envelopeVersion == EnvelopeVersion.Soap12)
79else if (envelopeVersion == EnvelopeVersion.Soap11)
83else if (envelopeVersion == EnvelopeVersion.None)
144if ((String.Compare(code.Namespace, EnvelopeVersion.Soap11.Namespace, StringComparison.Ordinal) != 0) &&
145(String.Compare(code.Namespace, EnvelopeVersion.Soap12.Namespace, StringComparison.Ordinal) != 0))
193protected virtual void OnWriteDetail(XmlDictionaryWriter writer, EnvelopeVersion version)
200protected virtual void OnWriteStartDetail(XmlDictionaryWriter writer, EnvelopeVersion version)
202if (version == EnvelopeVersion.Soap12)
204else if (version == EnvelopeVersion.Soap11)
216OnWriteDetail(writer, EnvelopeVersion.Soap12); // Wrap in soap 1.2 by default
259public void WriteTo(XmlWriter writer, EnvelopeVersion version)
264public void WriteTo(XmlDictionaryWriter writer, EnvelopeVersion version)
276if (version == EnvelopeVersion.Soap12)
280else if (version == EnvelopeVersion.Soap11)
284else if (version == EnvelopeVersion.None)
296WriteTo12Driver(writer, EnvelopeVersion.None);
299void WriteTo12Driver(XmlDictionaryWriter writer, EnvelopeVersion version)
327void WriteFaultCode12Driver(XmlDictionaryWriter writer, FaultCode faultCode, EnvelopeVersion version)
358WriteTo12Driver(writer, EnvelopeVersion.Soap12);
397OnWriteDetail(writer, EnvelopeVersion.Soap11);
490EnvelopeVersion receivedVersion;
492ReceivedFault(FaultCode code, FaultReason reason, string actor, string node, XmlBuffer detail, EnvelopeVersion version)
556protected override void OnWriteDetail(XmlDictionaryWriter writer, EnvelopeVersion version)
584protected override void OnWriteStartDetail(XmlDictionaryWriter writer, EnvelopeVersion version)
619bool ShouldWriteDetailAttribute(EnvelopeVersion targetVersion, string prefix, string localName, string attributeValue)
625bool shouldSkip = this.receivedVersion == EnvelopeVersion.Soap12 // original incoming version
626&& targetVersion == EnvelopeVersion.Soap11 // version to serialize to
636return CreateFault12Driver(reader, maxBufferSize, EnvelopeVersion.None);
639static ReceivedFault CreateFault12Driver(XmlDictionaryReader reader, int maxBufferSize, EnvelopeVersion version)
678static FaultCode ReadFaultCode12Driver(XmlDictionaryReader reader, EnvelopeVersion version)
698return CreateFault12Driver(reader, maxBufferSize, EnvelopeVersion.Soap12);
737return new ReceivedFault(code, reason, actor, actor, detail, EnvelopeVersion.Soap11);
System\ServiceModel\Description\SoapHelper.cs (67)
44if (GetSoapVersionState(wsdlBinding, exporter) == EnvelopeVersion.None)
48EnvelopeVersion version = GetSoapVersion(wsdlBinding);
59if (GetSoapVersionState(endpointContext.WsdlBinding, exporter) == EnvelopeVersion.None)
68EnvelopeVersion version = GetSoapVersion(endpointContext.WsdlBinding);
75if (GetSoapVersionState(endpointContext.WsdlBinding, exporter) == EnvelopeVersion.None)
80EnvelopeVersion version = GetSoapVersion(endpointContext.WsdlBinding);
91if (GetSoapVersionState(endpointContext.WsdlBinding, exporter) == EnvelopeVersion.None)
95EnvelopeVersion version = GetSoapVersion(endpointContext.WsdlBinding);
106EnvelopeVersion version = GetSoapVersion(endpointContext.WsdlBinding);
114EnvelopeVersion version = GetSoapVersion(endpointContext.WsdlBinding);
121internal static void SetSoapVersion(WsdlEndpointConversionContext endpointContext, WsdlExporter exporter, EnvelopeVersion version)
149internal static EnvelopeVersion GetSoapVersion(WsdlNS.Binding wsdlBinding)
154return o is WsdlNS.Soap12Binding ? EnvelopeVersion.Soap12 : EnvelopeVersion.Soap11;
156return EnvelopeVersion.Soap12;
159private static void SetSoapVersionState(WsdlNS.Binding wsdlBinding, WsdlExporter exporter, EnvelopeVersion version)
165versions = new Dictionary<WsdlNS.Binding, EnvelopeVersion>();
169((Dictionary<WsdlNS.Binding, EnvelopeVersion>)versions)[wsdlBinding] = version;
172private static EnvelopeVersion GetSoapVersionState(WsdlNS.Binding wsdlBinding, WsdlExporter exporter)
178if (versions != null && ((Dictionary<WsdlNS.Binding, EnvelopeVersion>)versions).ContainsKey(wsdlBinding))
180return ((Dictionary<WsdlNS.Binding, EnvelopeVersion>)versions)[wsdlBinding];
190internal static void ConvertExtensions(WsdlNS.ServiceDescriptionFormatExtensionCollection extensions, EnvelopeVersion version, ConvertExtension conversionMethod)
218internal delegate bool ConvertExtension(ref object src, EnvelopeVersion version);
220internal static bool ConvertSoapBinding(ref object src, EnvelopeVersion version)
232if (version == EnvelopeVersion.None)
238WsdlNS.SoapBinding dest = version == EnvelopeVersion.Soap12 ? new WsdlNS.Soap12Binding() : new WsdlNS.SoapBinding();
250internal static bool ConvertSoapAddressBinding(ref object src, EnvelopeVersion version)
262if (version == EnvelopeVersion.None)
268WsdlNS.SoapAddressBinding dest = version == EnvelopeVersion.Soap12 ? new WsdlNS.Soap12AddressBinding() : new WsdlNS.SoapAddressBinding();
281internal static bool ConvertSoapOperationBinding(ref object src, EnvelopeVersion version)
293if (version == EnvelopeVersion.None)
299WsdlNS.SoapOperationBinding dest = version == EnvelopeVersion.Soap12 ? new WsdlNS.Soap12OperationBinding() : new WsdlNS.SoapOperationBinding();
311internal static bool ConvertSoapMessageBinding(ref object src, EnvelopeVersion version)
347static WsdlNS.SoapBodyBinding ConvertSoapBodyBinding(WsdlNS.SoapBodyBinding src, EnvelopeVersion version)
349if (version == EnvelopeVersion.None)
352EnvelopeVersion srcVersion = GetBindingVersion<WsdlNS.Soap12BodyBinding>(src);
356WsdlNS.SoapBodyBinding dest = version == EnvelopeVersion.Soap12 ? new WsdlNS.Soap12BodyBinding() : new WsdlNS.SoapBodyBinding();
371static XmlElement ConvertSoapFaultBinding(XmlElement src, EnvelopeVersion version)
376if (version == EnvelopeVersion.Soap12)
381else if (version == EnvelopeVersion.Soap11)
402static WsdlNS.SoapFaultBinding ConvertSoapFaultBinding(WsdlNS.SoapFaultBinding src, EnvelopeVersion version)
404if (version == EnvelopeVersion.None)
410WsdlNS.SoapFaultBinding dest = version == EnvelopeVersion.Soap12 ? new WsdlNS.Soap12FaultBinding() : new WsdlNS.SoapFaultBinding();
422static WsdlNS.SoapHeaderBinding ConvertSoapHeaderBinding(WsdlNS.SoapHeaderBinding src, EnvelopeVersion version)
424if (version == EnvelopeVersion.None)
430WsdlNS.SoapHeaderBinding dest = version == EnvelopeVersion.Soap12 ? new WsdlNS.Soap12HeaderBinding() : new WsdlNS.SoapHeaderBinding();
445internal static EnvelopeVersion GetBindingVersion<T12>(object src)
447return src is T12 ? EnvelopeVersion.Soap12 : EnvelopeVersion.Soap11;
452static WsdlNS.SoapAddressBinding CreateSoapAddressBinding(EnvelopeVersion version, WsdlNS.Port wsdlPort)
456if (version == EnvelopeVersion.Soap12)
460else if (version == EnvelopeVersion.Soap11)
471static WsdlNS.SoapBinding CreateSoapBinding(EnvelopeVersion version, WsdlNS.Binding wsdlBinding)
475if (version == EnvelopeVersion.Soap12)
479else if (version == EnvelopeVersion.Soap11)
489static WsdlNS.SoapOperationBinding CreateSoapOperationBinding(EnvelopeVersion version, WsdlNS.OperationBinding wsdlOperationBinding)
493if (version == EnvelopeVersion.Soap12)
497else if (version == EnvelopeVersion.Soap11)
507static WsdlNS.SoapBodyBinding CreateSoapBodyBinding(EnvelopeVersion version, WsdlNS.MessageBinding wsdlMessageBinding)
511if (version == EnvelopeVersion.Soap12)
515else if (version == EnvelopeVersion.Soap11)
525static WsdlNS.SoapHeaderBinding CreateSoapHeaderBinding(EnvelopeVersion version, WsdlNS.MessageBinding wsdlMessageBinding)
529if (version == EnvelopeVersion.Soap12)
533else if (version == EnvelopeVersion.Soap11)
543static XmlElement CreateSoapFaultBinding(EnvelopeVersion version)
547if (version == EnvelopeVersion.Soap12)
552else if (version == EnvelopeVersion.Soap11)