The following error is reported when colleagues deploy good websites and WCF services on the target server:
The remote server returned an error: (415) cannot process the message because the content type 'text/XML; charset = UTF-8 'was not the expected type' application/soap + XML; charset = UTF-8 '..
Description: An unhandled exception occurred during the execution of the current Web request. Please review the stack trace for more information about the error and where it originated in the code.
The error message is in the format (415) that cannot be processed, because the client sent 'text/XML; charset = UTF-8 ', what the system expects is 'application/soap + XML; charset = UTF-8 '. This error is preliminarily determined because the communication protocols are inconsistent between the two parties. in bconfig, I found that my colleague corrected the binding error in endpoint during debugging and changed wshttpbinding to basichttpbinding, resulting in inconsistent Message format codes between the two parties.
Correct
<Endpoint address = "http: // 196.9.200.129: 8008/service" binding = "wshttpbinding" bindingconfiguration = "canonical" Contract = "servicereference1.iservice" name = "canonical">
:
Incorrect
<Endpoint address = "http: // 196.9.200.129: 8083/service. SVC" binding = "basichttpbinding" bindingconfiguration = "canonical" Contract = "servicereference1.iservice" name = "canonical">