Error
Error: Cannot obtain Metadata from localhost:81/WebServices/Legacy.svc If this is a Windows (R) Communication Foundation service to which you have access, please check that you have enabled metadata publishing at the specified address. For help enabling metadata publishing, please refer to the MSDN documentation at http://go.microsoft.com/fwlink/?LinkId=65455.WS-Metadata Exchange Error URI: localhost:81/WebServices/Legacy.svc Metadata contains a reference that cannot be resolved: 'localhost:81/WebServices/Legacy.svc'.
My Web.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>
Why I not able to access my webservices using WCF Test Client?
When I acess via URL localhost:81/WebServices/Legacy.svc in browser I get this error The filename, directory name, or volume label syntax is incorrect.
Update: My .svc file code
<%@ 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";
}
}