WCF - Cannot obtain Metadata

前端 未结 2 1121
Happy的楠姐
Happy的楠姐 2021-02-11 07:12

It is running in an Intranet using IIS 7 and it works fine whenever I enable Anonymous Authentication in the IIS Manager. If I disable it and try to run it using wcftestclient t

相关标签:
2条回答
  • 2021-02-11 07:33

    Remove the MEX endpoint and leave . Mex endpoints require anonymous authentication to be enabled.

    0 讨论(0)
  • 2021-02-11 07:38

    Javi was right, I had to remove the mex endpoint and just for the records, this is the final version of the 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>
    

    more details here, IIS hosted WCF-service + Windows auth in IIS + TransportCredentialOnly/Windows auth in basicHttpBinding

    0 讨论(0)
提交回复
热议问题