2014-03-19 86 views
0

我正在研究Web Service應用程序。此項目使用的工具是Windows Server 2012 Standard和Visual Studio Pro 2013.應用程序是C#.NET 4.5在Windows Server 2012上配置和安裝WCF應用程序

在此應用程序開發的早期階段,它處於概念證明階段。沒有數據庫,沒有任何幻想;試圖讓基本架構發揮作用。在開發環境中運行,一切正常。發佈到服務器不起作用。我得到404 - 當我嘗試在瀏覽器中打開此頁面時找不到文件或目錄。在我的開發系統/個人Web服務器上,我可以看到在顯示的頁面上運行的應用程序的結果。

我已經看過許多教程和關於如何做到這一點的分步說明。 Thisthis非常有幫助。

在服務器端的一些工作後,我的web部署功能從我的開發系統工作到服務器。我也嘗試了其他安裝技術。

由於我不知道IIS體系結構如何以及這似乎是問題所在,所以我已經到達了縮小問題的範圍,除非我誤解了運行我的測試/概念證明的某些方面。我從運行服務器的服務提供商那裏得到很多幫助,調試它。

有關如何縮小此問題的任何想法;在哪裏看,替代測試嘗試,非常感謝。

web.config文件(這是由

<?xml version="1.0" encoding="utf-8" ?> 
<configuration> 

    <appSettings> 
    <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" /> 
    </appSettings> 
    <system.web> 
    <compilation debug="false" /> 
    </system.web> 
    <!-- When deploying the service library project, the content of the config file must be added to the host's 
    app.config file. System.Configuration does not support config files for libraries. --> 
    <system.serviceModel> 
    <services> 
     <service name="Test.Service1"> 
     <host> 
      <baseAddresses> 
      <add baseAddress = "http://localhost:8371/Design_Time_Addresses/Test/Service1/" /> 
      </baseAddresses> 
     </host> 
     <!-- Service Endpoints --> 
     <!-- Unless fully qualified, address is relative to base address supplied above --> 
     <endpoint address="" binding="basicHttpBinding" contract="Test.IService1"> 
      <!-- 
       Upon deployment, the following identity element should be removed or replaced to reflect the 
       identity under which the deployed service runs. If removed, WCF will infer an appropriate identity 
       automatically. 
      --> 
      <identity> 
      <dns value="localhost"/> 
      </identity> 
     </endpoint> 
     <!-- Metadata Endpoints --> 
     <!-- The Metadata Exchange endpoint is used by the service to describe itself to clients. --> 
     <!-- This endpoint does not use a secure binding and should be secured or removed before deployment --> 
     <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/> 
     </service> 
    </services> 
    <behaviors> 
     <serviceBehaviors> 
     <behavior> 
      <!-- To avoid disclosing metadata information, 
      set the values below to false before deployment --> 
      <serviceMetadata httpGetEnabled="True" httpsGetEnabled="True"/> 
      <!-- To receive exception details in faults for debugging purposes, 
      set the value below to true. Set to false before deployment 
      to avoid disclosing exception information --> 
      <serviceDebug includeExceptionDetailInFaults="False" /> 
     </behavior> 
     </serviceBehaviors> 
    </behaviors> 
    </system.serviceModel> 

    </configuration> 
+0

你可以發佈你的web.config文件?大多數錯誤在wcf的部署中,來自接口請求的內容與web配置中定義的內容,也可能有助於顯示您的Web服務端點之一未按預期工作。 –

回答

0

添加該到配置解決了這個問題產生的仿製版本。

<system.webServer> 
    <handlers> 
     <add name="svc-Integrated" path="*.svc" verb="*" type="System.ServiceModel.Activation.HttpHandler, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" resourceType="File" requireAccess="Script" preCondition="integratedMode" /> 
    </handlers> 
</system.webServer> 
相關問題