簡體   English   中英

WCF服務方法在運行Visual Studio時可以正常運行,但不能從IIS中運行,我是否需要特殊配置?

[英]WCF Service method working fine when run visual studio but not working from IIS, do I special config?

早上好,

我已經創建了WCF Web服務,當我從Visual Studio中執行它時,它可以正常工作,但是當我部署它並從IIS中運行它時,該Web服務方法似乎不起作用,它只是返回一個空白頁,沒有錯誤不是沒有。 我認為問題可能出在配置文件上。 請查看我的配置文件:

<system.serviceModel>
    <services>
      <service name="MyWebService.MyService" behaviorConfiguration="ServiceBehaviour">
      <endpoint address="" binding="webHttpBinding"
          contract="MyWebService.IMyService" behaviorConfiguration="web" />

      <endpoint address="mex" binding="mexHttpBinding"
          contract="IMetadataExchange" />
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="ServiceBehaviour">
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="true" />
        </behavior>
        <behavior>
          <serviceMetadata httpGetEnabled="true" />
        </behavior>
      </serviceBehaviors>
      <endpointBehaviors>
        <behavior name="web">
          <webHttp />
        </behavior>
      </endpointBehaviors>
    </behaviors>
    <protocolMapping>
        <add binding="basicHttpsBinding" scheme="https" />
    </protocolMapping>    
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
</system.serviceModel>

  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
    <directoryBrowse enabled="true"/>
  </system.webServer>

我在配置文件上缺少什么嗎?

順便說一句,我正在使用Visual Studio 2013,C#,IIS7

在此先感謝大家!

我已經解決了此問題,方法是將SQL Server配置為由IIS(應用程序池)訪問。

這解決了問題。

暫無
暫無

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

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