2012-07-02 3 views
0

WCF의 구성은 최근에 실패했습니다. 계약은 .NET Framework의 일부로 사용할 수 있기 때문에, 나는 오류? 다음과 같은 오류가 발생 될 왜wcf 구성 문제 (오류)

<system.serviceModel> 

    <!-- Set up Custom Behaviors --> 
    <behaviors> 

     <endpointBehaviors> 
     <behavior name="jsonBehavior"> 
      <enableWebScript /> 
     </behavior> 
     </endpointBehaviors> 


     <serviceBehaviors> 
     <behavior name="WebPostService.Service1Behavior"> 
      <serviceMetadata httpGetEnabled="true" /> 
      <!-- --> 
      <serviceDebug includeExceptionDetailInFaults="false" /> 
     </behavior> 
     </serviceBehaviors> 


    </behaviors> 


    <!-- Set up the binding configuration --> 
    <bindings> 

     <basicHttpBinding> 
     <binding name="SOAPBinding"> 
      <security mode="None"> 
      <transport clientCredentialType="None" /> 
      </security> 
     </binding> 
     </basicHttpBinding> 

     <webHttpBinding> 
     <binding name="JSONBinding" 
       hostNameComparisonMode="StrongWildcard" 
       receiveTimeout="00:10:00" 
       sendTimeout="00:10:00" 
       openTimeout="00:10:00" 
       closeTimeout="00:10:00" 
       maxReceivedMessageSize="1000000" 
       maxBufferPoolSize="2000000" 
       bypassProxyOnLocal="false" 
       useDefaultWebProxy="true" > 
      <security mode="None"> 
      <transport clientCredentialType="None" /> 
      </security> 
     </binding> 
     </webHttpBinding> 


    </bindings> 

    <services> 


     <service behaviorConfiguration="WebPostService.Service1Behavior" 
       name="WebPostService.WebPostSvc" 
     > 

     <endpoint address="soap" 
        binding="basicHttpBinding" 
        bindingConfiguration="SOAPBinding" 
        contract="WebPostService.IWebPostSvc" 
     /> 

     <endpoint address="json" 
        binding="webHttpBinding" 
        bindingConfiguration="JSONBinding" 
        behaviorConfiguration="jsonBehavior" 
        contract="WebPostService.IWebPostSvc" 

     /> 

     <!-- --> 
     <endpoint address="mex" 
        binding="mexHttpBinding" 
        contract="System.ServiceModel.Description.IMetadataExchange" 
     /> 

     </service> 

    </services> 

    </system.serviceModel> 

은 수수께끼 것 같다 : 나는 다음과 같은 구성을 가지고있다. NET 3.5를 사용하고 있습니다.

[InvalidOperationException: The contract name 'System.ServiceModel.Description.IMetadataExchange' could not be found in the list of contracts implemented by the service 'WebPostSvc'.] 
    System.ServiceModel.Description.ConfigLoader.LookupContract(String contractName, String serviceName) +11679727 
    System.ServiceModel.Description.ConfigLoader.LoadServiceDescription(ServiceHostBase host, ServiceDescription description, ServiceElement serviceElement, Action`1 addBaseAddress) +11678779 
    System.ServiceModel.ServiceHostBase.LoadConfigurationSectionInternal(ConfigLoader configLoader, ServiceDescription description, ServiceElement serviceSection) +55 
    System.ServiceModel.ServiceHostBase.LoadConfigurationSectionInternal(ConfigLoader configLoader, ServiceDescription description, String configurationName) +35 
    System.ServiceModel.ServiceHostBase.ApplyConfiguration() +69 
    System.ServiceModel.ServiceHostBase.InitializeDescription(UriSchemeKeyedCollection baseAddresses) +190 
    System.ServiceModel.ServiceHost.InitializeDescription(Type serviceType, UriSchemeKeyedCollection baseAddresses) +32 
    System.ServiceModel.ServiceHost..ctor(Type serviceType, Uri[] baseAddresses) +139 
    System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(Type serviceType, Uri[] baseAddresses) +28 
    System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(String constructorString, Uri[] baseAddresses) +331 
    System.ServiceModel.HostingManager.CreateService(String normalizedVirtualPath) +11729164 
    System.ServiceModel.HostingManager.ActivateService(String normalizedVirtualPath) +42 
    System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) +479 

[ServiceActivationException: The service '/WebPostSvc.svc' cannot be activated due to an exception during compilation. The exception message is: The contract name 'System.ServiceModel.Description.IMetadataExchange' could not be found in the list of contracts implemented by the service 'WebPostSvc'..] 
    System.ServiceModel.AsyncResult.End(IAsyncResult result) +11599786 
    System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +194 
    System.ServiceModel.Activation.HostedHttpRequestAsyncResult.ExecuteSynchronous(HttpApplication context, Boolean flowContext) +176 
    System.ServiceModel.Activation.HttpModule.ProcessRequest(Object sender, EventArgs e) +278 
    System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +68 
    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75 

답변

0

그냥 사용 계약에 전체 이름을 필요 없어요

<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />