2012-02-15 53 views
0

我部署一個WCF服務到IIS 7,當我瀏覽到服務URL,我得到這樣的頁面:WCF默認端點失蹤

Service Landing Page

我沒有得到這樣的典型的着陸頁(從網上覆制只是爲了顯示例如,數據模糊,以保護無辜者):

enter image description here

有人能告訴我什麼,我做錯了什麼?該服務按預期工作,但此服務的用戶無法查看哪些方法或獲取WSDL的位置。

這裏是我的相關文件:

App.Config中(服務項目,並複製到服務站點的Web.config IIS)

<system.web> 
    <compilation debug="true"/> 
    </system.web> 

    <system.serviceModel> 
    <services> 
     <service name="MyService.MyService" behaviorConfiguration="Web"> 
     <clear /> 

     <endpoint address="" 
        binding="wsHttpBinding" 
        name="ws" 
        behaviorConfiguration="Web" 
         contract="MyService.IMyService" /> 
<!--   
      <endpoint address="" 
        behaviorConfiguration="Web" 
        binding="webHttpBinding" 
        bindingConfiguration="" 
        name="web" 
        contract="MyService.IMyService" /> 
--> 

     <host> 
      <baseAddresses> 
      <add baseAddress="http://services.mydomain.com/MyService" /> 
      </baseAddresses> 
     </host> 

     </service> 
    </services> 
    <behaviors> 
     <serviceBehaviors> 
     <behavior name="Web"> 
      <serviceMetadata httpGetEnabled="True"/> 
      <serviceDebug includeExceptionDetailInFaults="False"/> 
     </behavior> 
     </serviceBehaviors> 
     <endpointBehaviors> 
     <behavior name="Web"> 
      <webHttp /> 
     </behavior> 
     </endpointBehaviors> 
    </behaviors> 
    </system.serviceModel> 

MyService.svc

​​

我也嘗試使用'webHttpBinding'而不是'wsHttpBinding',它似乎沒有mak有區別。

+0

當你說你複製了app.config時,你將它重命名爲web.config for IIS,對吧? – 2012-02-15 18:45:18

+0

是的,我做到了,很好(趕快更新了帖子來表明這一點)。 – BrianKE 2012-02-15 18:48:49

+0

看不出有什麼明顯的錯誤,你是否在web.config中嘗試了故意的語法錯誤,以確保它能夠從該位置讀取? – 2012-02-15 18:51:48

回答

0

ServiceHost Service =「MyService.MyService」...這一行是否正確?

+0

這是正確的。它是對名稱空間和類的引用,因爲它是作爲DLL導入到此項目中的。 – BrianKE 2012-02-17 19:17:52