そこで、WCF サービス アプリケーションを作成し、IIS7 でホストしました。現在、いくつかのテスト 'helloworld' メソッドがあります。ブラウザで実行すると、次の画面が表示されます。
現在、サービス自体はうまく機能していますが、次のような操作を表示するにはどうすればよいですか。
リンクの marc_s に感謝します: http://www.dotnetcurry.com/ShowArticle.aspx?ID=399これをたどったので、Web 構成は次のようにセットアップされました。
<?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
)