2012-04-28 4 views
2

IIS 7을 사용하는 인트라넷에서 실행 중이며 IIS 관리자에서 익명 인증을 사용할 때마다 올바르게 작동합니다. 나는 그것을 비활성화하려고하면 당신은 내가 '볼 수 있듯이,WCF - 메타 데이터를 가져올 수 없습니다.

Error: Cannot obtain Metadata from http://myserver/testing/eval.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: http://myserver/testing/eval.svc Metadata contains a reference that cannot be resolved: 'http://myserver/testing/eval.svc'. The HTTP request is unauthorized with client authentication scheme 'Anonymous'. 

이 내 web.config 파일, 내가받을 다음과 같은 오류 다음의 WcfTestClient를 사용하여

<system.serviceModel> 
<bindings> 
    <wsHttpBinding> 
     <binding name="Binding1"> 
      <security mode="Transport"> 
       <transport clientCredentialType="Windows" /> 
       <message establishSecurityContext="true" /> 
      </security> 
     </binding> 
    </wsHttpBinding> 
    <basicHttpBinding> 
     <binding name="httpBinding"> 
      <security mode="Transport"> 
       <transport clientCredentialType="Windows" /> 
      </security> 
     </binding> 
    </basicHttpBinding>  
</bindings> 

<services> 
    <service behaviorConfiguration="ServiceBehavior" name="EvalServiceLibrary.EvalService"> 
    <endpoint address="" binding="wsHttpBinding" bindingConfiguration="Binding1" contract="EvalServiceLibrary.IEvalService"> 
     <identity> 
     <dns value="myserver.mydomain.com" /> 
     </identity> 
    </endpoint> 
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> 
    <endpoint address="basic" binding="basicHttpBinding" contract="EvalServiceLibrary.IEvalService" /> 
    </service> 
</services> 

<behaviors> 
    <serviceBehaviors> 
    <behavior name="ServiceBehavior"> 
     <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment --> 
     <serviceMetadata httpGetEnabled="true" /> 
     <!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information --> 
     <serviceDebug includeExceptionDetailInFaults="false" /> 
    </behavior> 
    </serviceBehaviors> 
</behaviors> 

를 실행합니다 mxHttpBinding 엔드 포인트를 사용하여 메타 데이터를 채우기. 그래서 어떤 조언을 환영합니다.

고맙습니다. m0dest0.

답변

5

MEX 끝점을 제거하고 나가십시오. Mex 엔드 포인트는 익명 인증이 사용 가능해야합니다.

3

하비 잘했다, 나는 MEX 엔드 포인트를 제거했다 단지 기록을 위해, 이것은의 Web.config의 최종 버전입니다 : 여기

<system.serviceModel> 
<bindings> 
    <basicHttpBinding> 
     <binding name="basicBinding"> 
      <security mode="TransportCredentialOnly"> 
       <transport clientCredentialType="Windows" /> 
      </security> 
     </binding> 
    </basicHttpBinding> 
</bindings> 
<services> 
    <service name="EvalServiceLibrary.EvalService" behaviorConfiguration="ServiceBehavior"> 
     <endpoint address="" binding="basicHttpBinding" bindingConfiguration="basicBinding" contract="EvalServiceLibrary.IEvalService"> 
     </endpoint> 
    </service> 
</services> 
<behaviors> 
    <serviceBehaviors> 
     <behavior name="ServiceBehavior"> 
      <serviceDebug includeExceptionDetailInFaults="true" /> 
      <serviceMetadata httpGetEnabled="false" /> 
     </behavior> 
    </serviceBehaviors> 
</behaviors> 
</system.serviceModel> 

자세한 내용은, IIS hosted WCF-service + Windows auth in IIS + TransportCredentialOnly/Windows auth in basicHttpBinding

관련 문제