WCF终结点设置问题

MOTA 2012-05-24 10:39:55
我建立的是 WCF服务应用程序
他是寄宿在IIS中的
调试的时候是开启VS IIS进行调试的
我通过WCF 配置编辑器设置了如下内容
----
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0"/>
</system.web>
<system.serviceModel>
<services>
<service name="WcfService1.Service1">
<endpoint address="http://localhost:5346/mys" binding="basicHttpBinding"
bindingConfiguration="" contract="WcfService1.IService1" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
<behavior name="WcfService1.Service1" />
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true"/>
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
<!--
To browse web app root directory during debugging, set the value below to true.
Set to false before deployment to avoid disclosing web app folder information.
-->
<directoryBrowse enabled="true"/>
</system.webServer>
</configuration>
-----------------------------
这样的话 我直接访问
http://localhost:5346/Service1.svc
告诉我的是

如果在配置中将“system.serviceModel/serviceHostingEnvironment/multipleSiteBindingsEnabled”设置为 true,则需要终结点指定相对地址。如果在终结点上指定相对侦听 URI,则该地址可以是绝对地址。若要解决此问题,请为终结点“http://localhost:5346/mys”指定相对 URI。

--------------------------------
而访问http://localhost:5346/mys
则是404 NOT FOUND

请教我该如何设置WCF的配置文件?让我能通过
http://localhost:5346/mys 访问服务?
...全文
344 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

110,539

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

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