所以我創建了一個WCF服務應用程序並將其託管在IIS7上。它目前有一些測試'helloworld'的方法。當我在瀏覽器中運行它,我得到這個屏幕: 顯示WCF Web服務操作
現在服務本身的偉大工程,但我怎麼能顯示的操作是這樣的:
感謝marc_s的鏈接:http://www.dotnetcurry.com/ShowArticle.aspx?ID=399這我已經遵循,所以我的網絡配置現在安裝如下:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
<system.serviceModel>
<services>
<service name="WcfServer.Service1">
<endpoint address="" binding="webHttpBinding" contract="WcfServer.IService1" behaviorConfiguration="HelpBehaviour" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="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>
<endpointBehaviors>
<behavior name="AjaxBehavior">
<enableWebScript />
</behavior>
<behavior name="HelpBehaviour">
<webHttp helpEnabled="true"/>
</behavior>
</endpointBehaviors>
</behaviors>
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true" />
<directoryBrowse enabled="true" showFlags="Date, Time, Size, Extension" />
</system.webServer>
</configuration>
但是,這隻適用於本地。當我在IIS7上發佈到我的服務器時,當我單擊幫助鏈接時,出現404錯誤頁面。有人知道這是爲什麼,或者之前遇到過嗎?
(最後一位得到解決運行:aspnet_regiis.exe -iru
)
你是最好的使用WCFTestClient在C測試WCF:\程序文件(x86)\微軟的Visual Studio 10.0 \ Common7 \ IDE(適用於VS 2010) – 2011-02-03 12:14:20
這是我做的第一件事:哪些工作正常! – 2011-02-03 12:24:54