WCF+iis 报未找到终结点

Heartbeats6 2017-02-14 11:27:43

配置文件
<?xml version="1.0" encoding="utf-8"?>
<configuration>

<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
<connectionStrings>
<add name="FORCTEST" connectionString="Data Source=SUNWIN55;Persist Security Info=false;User Id=scal_icrew;Password=scal_icrew" providerName="System.Data.SqlClient" />
</connectionStrings>
<system.serviceModel>
<services>
<service name="IFOCRestService.FOCTEST" behaviorConfiguration="RESTBehaviour">
<endpoint address=""
binding="webHttpBinding"
contract="IFOCRestService.IFOCTEST"
behaviorConfiguration="ESEndPointBehavior"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="RESTBehaviour">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>

<behavior>
<!-- To avoid disclosing metadata information, set the values below to false before deployment -->
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="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="ESEndPointBehavior">
<webHttp/>
</behavior>
</endpointBehaviors>
</behaviors>
<protocolMapping>
<add binding="basicHttpsBinding" scheme="https" />
</protocolMapping>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
<!--
若要在调试过程中浏览 Web 应用程序根目录,请将下面的值设置为 True。
在部署之前将该值设置为 False 可避免泄露 Web 应用程序文件夹信息。
-->
<directoryBrowse enabled="true"/>
</system.webServer>

</configuration>


接口方法

/// <summary>
/// 登陆方法
/// </summary>
/// <param name="user_code">账号</param>
/// <param name="password">密码</param>
/// <returns>返回P_CODE</returns>
[OperationContract]
[WebInvoke(Method = "POST", UriTemplate = "Login/user_code={user_code}/password={password}", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
string Login(string user_code, string password);
...全文
296 2 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
Poopaye 2017-02-20
  • 打赏
  • 举报
回复
引用 楼主 u010331683 的回复:
<services> <service name="IFOCRestService.FOCTEST" behaviorConfiguration="RESTBehaviour"> <endpoint address="" binding="webHttpBinding" contract="IFOCRestService.IFOCTEST"
终结点=endpoint
  • 打赏
  • 举报
回复
你新建一个wcf 文件,看看config会增加哪些配置,然后对照自己的config看看

62,242

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧