나는 WCF를 처음 접했고 지난주 동안 모든 것이 작동하도록 노력하고 있습니다. service.svc 파일을 검색 할 때 메타 데이터가 활성화되지 않았다는 메시지를받습니다. 이것에 대한 게시물이 수백 개 있지만 뭔가 빠진 것 같습니다. 지침을 올바르게 따랐지만 여전히 오류를 찾을 수 없습니다. 내가 어디로 잘못 가고 있습니까? 도움을 주시면 감사하겠습니다.
service.svc
<%@ ServiceHost Service="BiteSizeLearningWS.TranscriptService" Debug="true" %>
web.config
<services>
<service name="BiteSizeLearningWS.iServiceInterface" behaviorConfiguration="TranscriptServiceBehavior">
<endpoint address="" binding="basicHttpBinding" contract="BiteSizeLearningWS.TranscriptService" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="TranscriptServiceBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
서비스 계약
namespace BiteSizeLearningWS
{
[ServiceContract (Name="TranscriptService")]
public interface iServiceInterface{...
이행
public class TranscriptService : iServiceInterface
Global.asax
namespace BiteSizeLearningWS
{
public class Global : System.Web.HttpApplication
{
protected void Application_Start(object sender, EventArgs e)
{
RouteTable.Routes.Add(new ServiceRoute("TranscriptService", new WebServiceHostFactory(), typeof(TranscriptService)));
}
나는 당신이 가지고 있다고 생각합니다 :
<service name="BiteSizeLearningWS.iServiceInterface"...
이름 속성 값 및
<endpoint address="" ... contract="BiteSizeLearningWS.TranscriptService" />
계약 속성 값이 혼동되었습니다. 이 시도:
<service name="BiteSizeLearningWS.TranscriptService"...
과
<endpoint address="" ... contract="BiteSizeLearningWS.iServiceInterface" />
작동하면 WCF가 질문에 표시된 잘못된 구성 대신 서비스에 대한 자동 기본 구성 값을 사용한 것입니다. 메타 데이터 끝점은 기본적으로 활성화되어 있지 않으므로 "비활성화 됨"메시지가 표시됩니다.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다