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 访问服务?