0
votes

I created WCF service that's going to be consumed by a third-party that needs to accept content-type application/xml;charset=utf-8 and SOAP 1.1 envelope namespace. The service is currently accepting text/xml;charset=utf-8. Having the client change the content-type is not an option.

I haven't made any changes to the web.config file, except setting the basicHttpBinding maxReceivedMessageSize.

  <bindings>
      <basicHttpBinding>
        <binding name="http" maxReceivedMessageSize="2147483647"/>
      </basicHttpBinding>
    </bindings>   
1

1 Answers

0
votes

This issue typically due to the service type. Traditional SOAP web service based on the web service specification, SOAP envelope is the communication carrier and content-type is “application/soap+xml; charset=utf-8” or “text/xml;charset=utf-8”(for compatible with XML web service).
https://en.wikipedia.org/wiki/SOAP
The specifical HTTP header is commonplace in the Restful style service. WCF could create a restful style service too.
https://docs.microsoft.com/en-us/dotnet/framework/wcf/feature-details/wcf-web-http-programming-model
Example.
https://docs.microsoft.com/en-us/dotnet/framework/wcf/feature-details/how-to-create-a-basic-wcf-web-http-service
Here is an example I ever wrote.
How to fix "ERR_ABORTED 400 (Bad Request)" error with Jquery call to C# WCF service?
Feel free to let me know if there is anything I can help with.