簡體   English   中英

無法使用來自wcftestclient的wcf服務

[英]Unable to consume wcf service from wcftestclient

我正在嘗試通過WCF測試客戶端使用WCF服務。 當我的WCF服務/主機和客戶端位於另一台計算機上時,在同一台計算機上運行正常時,出現錯誤

“錯誤:無法從http://10.15.4.116:8000/hello獲取元數據。如果這是您有權訪問的Windows(R)Communication Foundation服務,請檢查是否已在指定的地址啟用元數據發布。
有關啟用元數據發布的幫助,請參閱MSDN文檔,網址為
http://go.microsoft.com/fwlink/?LinkId=65455.WS-Metadata交換錯誤
URI: http//10.15.4.1168000 / hello
元數據包含無法解析的引用:“ http://10.15.4.116:8000/hello”。
內容類型application / soap + xml; 服務http://10.15.4.116:8000/hello不支持charset = utf-8。 客戶端和服務綁定可能不匹配。 遠程服務器返回錯誤:(415)由於內容類型為'application / soap + xml,因此無法處理該消息; charset = utf-8'不是預期的類型'text / xml; charset = utf-8'.. HTTP GET錯誤URI: http ://10.15.4.116:8000/hello無法將URL http://10.15.4.116:8000/hello上的文檔識別為已知文檔類型。每種已知類型的錯誤消息可能會幫助您解決問題:-來自“ XML模式”的報告為“無法識別文檔格式(內容類型為“文本/ html; charset = UTF-8”)。”-報告來自'http://10.15.4.116:8000/hello'的是'無法識別文檔格式(內容類型為'text / html; charset = UTF-8')。'-來自'DISCO Document'的報告為“下載'http:// localhost:8000 / hello?disco'時出錯。”。 -無法連接到遠程服務器-無法建立連接,因為目標計算機主動拒絕它127.0.0.1:8000-“ WSDL文檔”的報告為“無法識別文檔格式(內容類型為'text / html' ; charset = UTF-8')。”。

我的應用程序的配置文件部分是:-

  <configuration>
    <system.serviceModel>
      <behaviors>
        <serviceBehaviors>
          <behavior name="SimpleServiceBehavior">
            <serviceMetadata httpGetEnabled="True" policyVersion="Policy12" />
          </behavior>
        </serviceBehaviors>
      </behaviors>
    </system.serviceModel>
  </configuration>

錯誤消息的結尾說明了所有錯誤:

由於內容類型為'application / soap + xml,因此無法處理該消息; charset = utf-8'不是預期的類型'text / xml; charset = utf-8'

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM