簡體   English   中英

在IIS 7.5中部署WCF服務

[英]Deploy WCF service in IIS 7.5

我是WCF的新手。 我正在尋找在IIS上部署WCF並使用該服務的步驟。 我已按照與在IIS上部署網站相同的步驟進行操作,還將默認文檔設置為Service1.svc

現在,當我嘗試使用此wcf服務時,它給了我以下錯誤。

Metadata contains a reference that cannot be resolved: 'http://manish-pc:8000/Service1.svc?wsdl'.
The WSDL document contains links that could not be resolved.
There was an error downloading 'http://manish-pc:8000/Service1.svc?xsd=xsd0'.
The underlying connection was closed: An unexpected error occurred on a receive.
Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
An existing connection was forcibly closed by the remote host
Metadata contains a reference that cannot be resolved: 'http://localhost:8000/Service1.svc'.
Content Type application/soap+xml; charset=utf-8 was not supported by service http://localhost:8000/Service1.svc.  The client and service bindings may be mismatched.
The remote server returned an error: (415) Cannot process the message because the content type 'application/soap+xml; charset=utf-8' was not the expected type 'text/xml; charset=utf-8'..
If the service is defined in the current solution, try building the solution and adding the service reference again.

以下是我在Web.Config文件中的服務詳細信息

<system.serviceModel>
    <services>
      <service behaviorConfiguration="DemoWCF.Service1Behavior" name="DemoWCF.Service1">
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:8000/Service1.svc"/>
          </baseAddresses>
        </host>
        <endpoint address="http://localhost:8000/Service1.svc"
                  binding="basicHttpBinding"
                  contract="DemoWCF.IService1"
                  bindingConfiguration="basicBinding">
          <identity>
            <dns value="localhost"/>
          </identity>
        </endpoint> 
        <endpoint address="mex" 
                  binding="mexHttpBinding" 
                  contract="IMetadataExchange" />
      </service>
    </services>

    <bindings>
      <basicHttpBinding>
        <binding name="basicBinding" textEncoding="utf-8"></binding>
      </basicHttpBinding>
    </bindings>

    <behaviors>
      <serviceBehaviors>
        <behavior name="DemoWCF.Service1Behavior">
          <serviceMetadata httpGetEnabled="True" />
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>

請指導我缺少的地方以及應該采取的步驟。 謝謝。

在Google上搜索並觀看視頻后。 終於我找到了解決方案。

發生此錯誤是由於我不介意的IIS配置。

  1. 打開IIS管理器控制台。
  2. 制作一個單獨的申請池。
    一種)。 將.NET Framework版本設置為4.0
    B)。 托管管道模式:經典
  3. 將“應用程序池標識”設置為“ LocalSystem”。
  4. 遵循與在IIS上部署Web應用程序相同的步驟,例如創建虛擬目錄。
  5. 創建您已創建的應用程序池的虛擬目錄集。

並在客戶端應用程序中使用WCF服務。

點擊這里觀看視頻

如果您對此有更多了解,請更新此問題/答案線程。
謝謝 :)

暫無
暫無

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

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