[英]The content type application/xml;charset=utf-8 of the response message does not match the content type of the binding (text/xml; charset=utf-8), WCF
[英]wcf + The content type text/html of the response message does not match the content type of the binding (application/soap+xml; charset=utf-8)
我遇到以下錯誤“ 響應消息的內容類型text / html與綁定的內容類型不匹配(application / soap + xml; charset = utf-8)。如果使用自定義編碼器,請確保IsContentTypeSupported方法已正確實現。響應的前514個字節為” 。 以下是我的綁定和配置文件
<customBinding>
<binding name="LoginServiceSoap12Binding">
<textMessageEncoding messageVersion="Soap12" />
<httpsTransport />
</binding>
</customBinding>
<endpoint address="WCF URL"
binding="customBinding" bindingConfiguration="LoginServiceSoap12Binding"
contract="CWALoginService.LoginServicePortType" name="LoginServiceHttpsSoap12Endpoint" />
什么是不確定我在這里面臨的問題...
多數情況下,這意味着您的主機返回錯誤頁面(因為內容類型為所述的text/html
),而不是您的服務在application/soap+xml
返回響應。
您應該通過輸入服務的URL( http(s)://localhost{:port}/{subSite}/(WCF URL).svc
)檢查服務是否可以成功激活。 如果您的服務可以被激活,那么接下來您應該嘗試的是通過以下步驟在客戶端和服務端啟用wcf跟蹤:
Edit WCF Configuration
Diagnostics
部分,啟用Log Auto Flush
, MessageLogging
和Tracing
,當然指定您的主機的身份訪問寫的路徑。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.