.Net Core 3.1: The text encoding 'iso-8859-1' used in the text message format is not supported. (Parameter 'encoding')

Viewed 1772

I am trying to connect to an external Web Service with encoding ISO-8859-1 (the web service has PHP implementation) using VS 2019, .net core 3. I add Connected Service. When create new basic http binding with encoding, i get exception with message "The text encoding 'iso-8859-1' used in the text message format is not supported. (Parameter 'encoding')".

***var binding = new BasicHttpBinding(BasicHttpSecurityMode.Transport)
        {
            MaxReceivedMessageSize = int.MaxValue,
            MaxBufferPoolSize = int.MaxValue,
            MaxBufferSize = int.MaxValue,
            ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max,
            AllowCookies = true,
            TextEncoding = Encoding.GetEncoding("ISO-8859-1"),
        };***

What's my mistake?

1 Answers
Related