diff options
author | Steve Pfister <steveisok@users.noreply.github.com> | 2019-12-13 14:26:53 +0300 |
---|---|---|
committer | Alexander Köplinger <alex.koeplinger@outlook.com> | 2019-12-13 14:26:53 +0300 |
commit | 97bf0a1bcca8acecce6026d1f89d834461b03390 (patch) | |
tree | 9e62dca8fcd2af228c325ecd7499d5befb6574bf /mcs/class/referencesource | |
parent | 0dc19600d120a5ea2731bbdbb82b067e87de65e7 (diff) |
Relax faultcode parsing for Soap11 message errors. (#18154)
* Relax faultcode parsing for Soap11 message errors.
The mono implementation was reading the faultcode content as an XmlQualifiedName, which applied the rule where you could not
start a name with a number. This caused interoperability problems with the .net framework because their parsing just looks
for <namespace>:<name>, where name can be any string.
Example:
<faultcode>s:1</faultcode>
On mono, a soap response that contains a fault code name of 1 will throw an error. If you run the same code on the .net framework, it will not.
Fixes https://github.com/mono/mono/issues/12995
* [csproj] Update project files
Diffstat (limited to 'mcs/class/referencesource')
-rw-r--r-- | mcs/class/referencesource/System.ServiceModel/System/ServiceModel/XmlUtil.cs | 2 | ||||
-rw-r--r-- | mcs/class/referencesource/System.Xml/System/Xml/XmlCharType.cs | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/XmlUtil.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/XmlUtil.cs index fb5cb226f43..b196774a1b3 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/XmlUtil.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/XmlUtil.cs @@ -86,7 +86,9 @@ namespace System.ServiceModel int j; for (j = s.Length; j > 0 && IsWhitespace(s[j - 1]); j--); +#if !MONO Fx.Assert(j > i, "Logic error in XmlUtil.Trim()."); +#endif if (i != 0 || j != s.Length) { diff --git a/mcs/class/referencesource/System.Xml/System/Xml/XmlCharType.cs b/mcs/class/referencesource/System.Xml/System/Xml/XmlCharType.cs index 725920a5805..8f6f769f23f 100644 --- a/mcs/class/referencesource/System.Xml/System/Xml/XmlCharType.cs +++ b/mcs/class/referencesource/System.Xml/System/Xml/XmlCharType.cs @@ -750,7 +750,7 @@ namespace System.Xml { // This method tests whether a value is in a given range with just one test; start and end should be constants private static bool InRange(int value, int start, int end) { Debug.Assert(start <= end); - return (uint)(value - start) <= (uint)(end - start); + return (uint)(value - start) <= (uint)(end - start); } #if XMLCHARTYPE_GEN_RESOURCE |