FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\MessageFault.cs (33)
68EnvelopeVersion envelopeVersion = message.Version.Envelope;
70if (envelopeVersion == EnvelopeVersion.Soap12)
74else if (envelopeVersion == EnvelopeVersion.Soap11)
78else if (envelopeVersion == EnvelopeVersion.None)
139if ((String.Compare(code.Namespace, EnvelopeVersion.Soap11.Namespace, StringComparison.Ordinal) != 0) &&
140(String.Compare(code.Namespace, EnvelopeVersion.Soap12.Namespace, StringComparison.Ordinal) != 0))
188protected virtual void OnWriteDetail(XmlDictionaryWriter writer, EnvelopeVersion version)
195protected virtual void OnWriteStartDetail(XmlDictionaryWriter writer, EnvelopeVersion version)
197if (version == EnvelopeVersion.Soap12)
199else if (version == EnvelopeVersion.Soap11)
211OnWriteDetail(writer, EnvelopeVersion.Soap12); // Wrap in soap 1.2 by default
254public void WriteTo(XmlWriter writer, EnvelopeVersion version)
259public void WriteTo(XmlDictionaryWriter writer, EnvelopeVersion version)
271if (version == EnvelopeVersion.Soap12)
275else if (version == EnvelopeVersion.Soap11)
279else if (version == EnvelopeVersion.None)
291WriteTo12Driver(writer, EnvelopeVersion.None);
294private void WriteTo12Driver(XmlDictionaryWriter writer, EnvelopeVersion version)
322private void WriteFaultCode12Driver(XmlDictionaryWriter writer, FaultCode faultCode, EnvelopeVersion version)
353WriteTo12Driver(writer, EnvelopeVersion.Soap12);
392OnWriteDetail(writer, EnvelopeVersion.Soap11);
485private EnvelopeVersion _receivedVersion;
487private ReceivedFault(FaultCode code, FaultReason reason, string actor, string node, XmlBuffer detail, EnvelopeVersion version)
551protected override void OnWriteDetail(XmlDictionaryWriter writer, EnvelopeVersion version)
579protected override void OnWriteStartDetail(XmlDictionaryWriter writer, EnvelopeVersion version)
614private bool ShouldWriteDetailAttribute(EnvelopeVersion targetVersion, string prefix, string localName, string attributeValue)
620bool shouldSkip = _receivedVersion == EnvelopeVersion.Soap12 // original incoming version
621&& targetVersion == EnvelopeVersion.Soap11 // version to serialize to
631return CreateFault12Driver(reader, maxBufferSize, EnvelopeVersion.None);
634private static ReceivedFault CreateFault12Driver(XmlDictionaryReader reader, int maxBufferSize, EnvelopeVersion version)
673private static FaultCode ReadFaultCode12Driver(XmlDictionaryReader reader, EnvelopeVersion version)
693return CreateFault12Driver(reader, maxBufferSize, EnvelopeVersion.Soap12);
732return new ReceivedFault(code, reason, actor, actor, detail, EnvelopeVersion.Soap11);
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\SoapHelper.cs (67)
45if (GetSoapVersionState(wsdlBinding, exporter) == EnvelopeVersion.None)
49EnvelopeVersion version = GetSoapVersion(wsdlBinding);
60if (GetSoapVersionState(endpointContext.WsdlBinding, exporter) == EnvelopeVersion.None)
69EnvelopeVersion version = GetSoapVersion(endpointContext.WsdlBinding);
76if (GetSoapVersionState(endpointContext.WsdlBinding, exporter) == EnvelopeVersion.None)
81EnvelopeVersion version = GetSoapVersion(endpointContext.WsdlBinding);
92if (GetSoapVersionState(endpointContext.WsdlBinding, exporter) == EnvelopeVersion.None)
96EnvelopeVersion version = GetSoapVersion(endpointContext.WsdlBinding);
107EnvelopeVersion version = GetSoapVersion(endpointContext.WsdlBinding);
115EnvelopeVersion version = GetSoapVersion(endpointContext.WsdlBinding);
122internal 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];
189internal static void ConvertExtensions(WsdlNS.ServiceDescriptionFormatExtensionCollection extensions, EnvelopeVersion version, ConvertExtension conversionMethod)
216internal delegate bool ConvertExtension(ref object src, EnvelopeVersion version);
218internal static bool ConvertSoapBinding(ref object src, EnvelopeVersion version)
230if (version == EnvelopeVersion.None)
236WsdlNS.SoapBinding dest = version == EnvelopeVersion.Soap12 ? new WsdlNS.Soap12Binding() : new WsdlNS.SoapBinding();
248internal static bool ConvertSoapAddressBinding(ref object src, EnvelopeVersion version)
260if (version == EnvelopeVersion.None)
266WsdlNS.SoapAddressBinding dest = version == EnvelopeVersion.Soap12 ? new WsdlNS.Soap12AddressBinding() : new WsdlNS.SoapAddressBinding();
279internal static bool ConvertSoapOperationBinding(ref object src, EnvelopeVersion version)
291if (version == EnvelopeVersion.None)
297WsdlNS.SoapOperationBinding dest = version == EnvelopeVersion.Soap12 ? new WsdlNS.Soap12OperationBinding() : new WsdlNS.SoapOperationBinding();
309internal static bool ConvertSoapMessageBinding(ref object src, EnvelopeVersion version)
345private static WsdlNS.SoapBodyBinding ConvertSoapBodyBinding(WsdlNS.SoapBodyBinding src, EnvelopeVersion version)
347if (version == EnvelopeVersion.None)
350EnvelopeVersion srcVersion = GetBindingVersion<WsdlNS.Soap12BodyBinding>(src);
354WsdlNS.SoapBodyBinding dest = version == EnvelopeVersion.Soap12 ? new WsdlNS.Soap12BodyBinding() : new WsdlNS.SoapBodyBinding();
369private static XmlElement ConvertSoapFaultBinding(XmlElement src, EnvelopeVersion version)
374if (version == EnvelopeVersion.Soap12)
379else if (version == EnvelopeVersion.Soap11)
400private static WsdlNS.SoapFaultBinding ConvertSoapFaultBinding(WsdlNS.SoapFaultBinding src, EnvelopeVersion version)
402if (version == EnvelopeVersion.None)
408WsdlNS.SoapFaultBinding dest = version == EnvelopeVersion.Soap12 ? new WsdlNS.Soap12FaultBinding() : new WsdlNS.SoapFaultBinding();
420private static WsdlNS.SoapHeaderBinding ConvertSoapHeaderBinding(WsdlNS.SoapHeaderBinding src, EnvelopeVersion version)
422if (version == EnvelopeVersion.None)
428WsdlNS.SoapHeaderBinding dest = version == EnvelopeVersion.Soap12 ? new WsdlNS.Soap12HeaderBinding() : new WsdlNS.SoapHeaderBinding();
443internal static EnvelopeVersion GetBindingVersion<T12>(object src)
445return src is T12 ? EnvelopeVersion.Soap12 : EnvelopeVersion.Soap11;
449private static WsdlNS.SoapAddressBinding CreateSoapAddressBinding(EnvelopeVersion version, WsdlNS.Port wsdlPort)
453if (version == EnvelopeVersion.Soap12)
457else if (version == EnvelopeVersion.Soap11)
468private static WsdlNS.SoapBinding CreateSoapBinding(EnvelopeVersion version, WsdlNS.Binding wsdlBinding)
472if (version == EnvelopeVersion.Soap12)
476else if (version == EnvelopeVersion.Soap11)
486private static WsdlNS.SoapOperationBinding CreateSoapOperationBinding(EnvelopeVersion version, WsdlNS.OperationBinding wsdlOperationBinding)
490if (version == EnvelopeVersion.Soap12)
494else if (version == EnvelopeVersion.Soap11)
504private static WsdlNS.SoapBodyBinding CreateSoapBodyBinding(EnvelopeVersion version, WsdlNS.MessageBinding wsdlMessageBinding)
508if (version == EnvelopeVersion.Soap12)
512else if (version == EnvelopeVersion.Soap11)
522private static WsdlNS.SoapHeaderBinding CreateSoapHeaderBinding(EnvelopeVersion version, WsdlNS.MessageBinding wsdlMessageBinding)
526if (version == EnvelopeVersion.Soap12)
530else if (version == EnvelopeVersion.Soap11)
540private static XmlElement CreateSoapFaultBinding(EnvelopeVersion version)
544if (version == EnvelopeVersion.Soap12)
549else if (version == EnvelopeVersion.Soap11)