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'.
내있는 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>
왜 WCF 테스트 클라이언트를 사용하여 내 웹 서비스에 액세스 할 수 없습니다?
내가 URL localhost를 통해 ACESS : 81/웹 서비스/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";
}
}
.svc 파일의 내용을 표시 할 수 있습니까? – Chris
당신은'mexHttpsBinding'을 가지고 있습니다 - 이것을'mexHttpBinding'으로 바꾸거나, 테스트 클라이언트를 로컬 HTTPS 끝점을 가리 키도록 변경하십시오. – StuartLC
@ 크리스 : 마크 업 : <% @ ServiceHost를 언어 = "C#을"디버그 = "true"를 서비스 = "MvcApplication4.WS.Service1"숨김 = "Service1.svc.cs"%> C# 코드 : 네임 스페이스 웹 .WebServices { [ServiceBehavior (AddressFilterMode = AddressFilterMode.Any)] 공용 클래스 레거시 : ILegacy { 공용 문자열 DoWork() { return "OK"; } } } –