所以我创建了一个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