2012-12-25 3 views
2

서비스에 의해 인증이 오류를 찾을 수 없습니다 :호출자가 나는 WCF를 사용하고

" The caller was not authenticated by the service."

내가 client.config 파일에이 코드를 사용하고 아래

<system.serviceModel> 
    <bindings> 
     <wsHttpBinding> 
     <binding name="WSDualHttpBinding_IReceiverController" closeTimeout="00:00:05" 
     openTimeout="00:00:05" receiveTimeout="00:10:00" sendTimeout="00:00:05" 
     bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" 
     maxBufferPoolSize="524288" maxReceivedMessageSize="65536" 
     messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"> 
      <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" 
       maxBytesPerRead="4096" maxNameTableCharCount="16384" /> 
      <reliableSession ordered="true" inactivityTimeout="00:10:00" /> 
      <security mode="None"> 
      <message clientCredentialType="Windows" negotiateServiceCredential="false" /> 
      </security> 
     </binding> 
     <binding name="WSHttpBinding_IEMRProWCFService" /> 
     </wsHttpBinding> 
    </bindings> 
    <client> 
     <endpoint address="http://pionbuggs-pc:4567/EMRProWCFService.svc" 
     binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IEMRProWCFService" 
     contract="EMRProWCFService.IEMRProWCFService" name="WSHttpBinding_IEMRProWCFService"> 
     <identity> 
      <dns value="http://pionbuggs-pc:4567/EMRProWCFService.svc" /> 
     </identity> 
     </endpoint> 
    </client> 
    </system.serviceModel> 

그리고는의 코드입니다 service.config 파일 :

대신 binding="wsHttpBinding"를 사용
<?xml version="1.0" encoding="UTF-8"?> 
<configuration> 

    <system.web> 
    <compilation /> 
    <httpRuntime maxRequestLength="2147483647" /> 

    </system.web> 

    <system.serviceModel> 
    <services> 
     <service name="WCFService.EMRProWCFService"> 
     <endpoint address="" binding="wsHttpBinding" contract="WCFService.IEMRProWCFService"> 
      <identity> 
      <dns value="http://pionbuggs-pc:4567/EMRProWCFService.svc" /> 
      </identity> 
     </endpoint> 
     <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> 
     </service> 
    </services> 

    <behaviors> 
     <serviceBehaviors> 
     <behavior> 
      <!-- 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="true" /> 
     </behavior> 
     </serviceBehaviors> 
    </behaviors> 
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" /> 
    <bindings> 
     <webHttpBinding> 
     <binding name="WebConfiguration" maxBufferSize="65536" maxReceivedMessageSize="2147483647" transferMode="Streamed"> 
     </binding> 
     </webHttpBinding> 
    </bindings> 
    </system.serviceModel> 
    <system.webServer> 
    <modules runAllManagedModulesForAllRequests="true" /> 
    <directoryBrowse enabled="true" /> 
    </system.webServer> 

</configuration> 

답변

2

, 단지 기본 사용해보십시오 에 서비스

<endpoint address="http://pionbuggs-pc:4567/EMRProWCFService.svc" 
    binding="basicHttpBinding" bindingConfiguration="WSHttpBinding_IEMRProWCFService" 
    contract="EMRProWCFService.IEMRProWCFService" name="WSHttpBinding_IEMRProWCFService"> 

과에 : 당신에게 클라이언트 endopint을 변경

<endpoint address="" binding="basicHttpBinding" contract="WCFService.IEMRProWCFService"> 

오류 당신은 당신이 그것을 요구하는 보안 제약을가하지 않는 한, 인증을 사용하는 데 필요한 고급 보안을 사용한다는 것입니다.

BasicHttpBinding vs WsHttpBinding vs WebHttpBinding

: 여기

그것에 대해 몇 가지 정보입니다