The content type text/xml; charset="utf-8" of the response message does not match the content type of the binding (text/xml; charset=utf-8)
It would indeed seem that the .NET Core version is more picky about this. In any case, I managed to solve it using a Custom Encoder.
I blatently stole the CustomTextMessageEncoder from Github. I added the following method:
public override bool IsContentTypeSupported(string contentType)
{
return true;
}
And stole CustomTextMessageBindingElement
and CustomTextMessageEncoderFactory
from the same place.
I added them by creating a custom binding (basicBinding is the binding I had before):
var customBindingElement = new CustomTextMessageBindingElement("UTF-8", "text/xml", MessageVersion.Soap11);
var binding = new CustomBinding(basicBinding);
binding.Elements.RemoveAt(0);
binding.Elements.Insert(0, customBindingElement);
var client = (T2)Activator.CreateInstance(typeof(T), binding, address);
I use Activator as I generate my proxies dynamically. Just replace with a call to the WCF generated client.
Quite a lot of work for two misplaced quotes :D