2011-03-29 171 views
0

我想在Windows 7 64位計算機上的IIS 7.5中託管使用​​.NET 3.5編寫的WCF服務,但沒有多少好運。我也在機器上安裝了Sharepoint 2010。這裏是我的設置:在IIS 7.5中託管WCFweb服務

與.svc文件的文件夾的物理路徑是: C:\的Inetpub \ wwwroot的\ SmartSolution \ SERVICES \ SERVICES \ ContainerManagementService.svc

我已經創造了IIS Web應用程序爲這兩個服務文件夾。

下面是WCF服務配置文件:

 <service behaviorConfiguration="MyNamespace.ContainerManagementServiceBehavior" 
    name="MyNamespace.ContainerManagementService"> 
    <endpoint address="" binding="basicHttpBinding" 
     name="ContainerManagementbasicHttpEndpoint" contract="MyNamespace.IContainer"/>     
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> 
    <host> 
     <baseAddresses> 
     <add baseAddress="http://localhost:8000/ContainerManagementService" /> 
     </baseAddresses> 
    </host> 
    </service>  
    <behaviors>  
    <behavior name="MyNamespace.ContainerManagementServiceBehavior"> 
     <serviceMetadata httpGetEnabled="true" /> 
     <serviceDebug includeExceptionDetailInFaults="false" /> 
    </behavior> 
</behaviors> 

當我嘗試瀏覽:http://localhost/SmartSolution/Services/Services/ContainerManagementService.svc,我得到以下錯誤: Service Error message

,如果我點擊「返回網站「出於某種原因,我被帶到Sharepoint中央管理員。我怎樣才能讓IIS服務託管工作?

謝謝!

回答

0

您已經暴露了服務上端口8000所以你需要在http://localhost:8000/ContainerManagementService

+0

端口沒有運氣來調用它。你怎麼能告訴它正在使用的端口8000,因爲它沒有在配置文件中設置?當我轉到「8000」URL時,出現「Internet Explorer無法顯示網頁」錯誤。 – laconicdev 2011-03-29 14:45:43

+0

因爲您在web.config中將其定義爲8000端口:'' – Aliostad 2011-03-29 14:48:02

+0

它將位於'http:// localhost:8000/ContainerManagementService' – Aliostad 2011-03-29 14:49:07