错误
错误:无法从中获取元数据 localhost:81 / WebServices / Legacy.svc如果这是一个Windows(R) 请访问您的Communication Foundation服务 检查您是否已在指定的位置启用元数据发布 地址。有关启用元数据发布的帮助,请参阅 MSDN文档在 http://go.microsoft.com/fwlink/?LinkId=65455.WS-Metadata交流 错误URI:localhost:81 / WebServices / Legacy.svc元数据 包含无法解析的引用: 的 'localhost:81 / Web服务/ Legacy.svc'
。
我的网站.Config
<system.serviceModel> <services> <service name="Web.WebServices.Legacy" behaviorConfiguration="serviceBehaviorsZero"> <endpoint address="" name="SspService" binding="basicHttpBinding" bindingConfiguration="basicHttpBindingZero" contract="Web.WebServices.ILegacy" /> <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" /> </service> </services> <bindings> <basicHttpBinding> <binding name="basicHttpBindingZero"> <security mode="None"> </security> </binding> </basicHttpBinding> </bindings> <behaviors> <serviceBehaviors> <behavior name="serviceBehaviorsZero"> <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" /> <serviceDebug includeExceptionDetailInFaults="false" /> </behavior> </serviceBehaviors> </behaviors> <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" /> </system.serviceModel>
为什么我无法使用 WCF测试客户端访问我的网络服务?
当我通过浏览器中的URL localhost:81 / WebServices / Legacy.svc访问时 我收到这个错误 文件名,目录名或卷标语法不正确。
更新:我的.svc文件代码
<%@ ServiceHost Language="C#" Debug="true" Service="Web.WebServices.Legacy" CodeBehind="Legacy.svc.cs" %>
[ServiceBehavior(AddressFilterMode = AddressFilterMode.Any)]
public class Legacy : ILegacy
{
public string DoWork()
{
return "https";
}
}
答案 0 :(得分:0)
将简单文件放在网站目录(hello.html)上,并检查它是否可以访问(helloworld.html)
你好,世界 你好,世界!!!
如果不起作用 - 请检查IIS上的绑定设置,以及服务及其应用程序池是否已打开。
希望有所帮助。 祝你好运!!!