我创建了一个WCF项目,我正在使用WCF测试客户端,我收到了返回的消息。但是,当我使用浏览器到端点地址时,我收到错误404.我的代码如下所示:
[WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Json, UriTemplate = "UpdateTbl/{tblName}")]
public string UpdateTbl(string tblName)
{ ... }
配置文件中的相关代码如下:
<system.serviceModel>
<services>
<service name="WcfJsonRestService.Service1" >
<endpoint address="http://thehost:47423/Service1" binding="webHttpBinding" contract="WcfJsonRestService.IService1" >
</endpoint>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="webHttp">
<webHttp helpEnabled="true" automaticFormatSelectionEnabled="true"/>
</behavior>
</endpointBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
如果您可以分享您的经验,请提供帮助。感谢。