The remote server returned an error: (415) cannot process the message because the content type specified

Source: Internet
Author: User
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">

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.