2009-03-16 2 views
3

큰 데이터 스트림을 처리해야하는 간단한 WCF 서비스가 있으므로 기본값보다 많은 구성 값이 있습니다. 최근에 모든 코드를 새롭고 재구성 된 솔루션으로 옮겼습니다. 이제 막 서비스를 검토했습니다. 그러나 WCFTestClient.exe 또는 VS2008의 "서비스 참조 추가"를 사용하여 클라이언트 프록시를 생성하려고하면 클라이언트 프록시 구성의 값이 서비스의 설치와 일치하지 않습니다.WCF - 클라이언트 프록시 구성이 web.config 서비스와 일치하지 않습니다.

서버 설정은 -

<system.serviceModel> 
    <bindings> 
     <basicHttpBinding> 
      <binding name="BasicHttpBinding_ISubjectConsentService" closeTimeout="00:01:00" 
       openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" 
       allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" 
       maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" 
       messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" 
       useDefaultWebProxy="true"> 
       <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" 
        maxBytesPerRead="4096" maxNameTableCharCount="16384" /> 
       <security mode="None"> 
        <transport clientCredentialType="None" proxyCredentialType="None" 
         realm="" /> 
        <message clientCredentialType="UserName" algorithmSuite="Default" /> 
       </security> 
      </binding> 
     </basicHttpBinding> 
    </bindings> 
    <client> 
     <endpoint address="http://server/Consent/services/SubjectConsent.svc" 
      binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_ISubjectConsentService" 
      contract="ServiceReference1.ISubjectConsentService" name="BasicHttpBinding_ISubjectConsentService" /> 
    </client> 
</system.serviceModel> 

클라이언트 프록시가 그 4를 가지고 여기

<system.serviceModel> 
    <bindings>  
     <basicHttpBinding> 
     <binding name="default" maxBufferSize="5000000" maxReceivedMessageSize="5000000"> 
      <readerQuotas maxStringContentLength="5000000" maxArrayLength="5000000" /> 
      <!-- turn this setting on to require SSL/https --> 
      <!-- <security mode="Transport" /> --> 
     </binding>  
     </basicHttpBinding> 
    </bindings> 
    <behaviors> 
     <serviceBehaviors> 
     <behavior name="Consent.Service.SubjectConsentServiceBehavior"> 
      <serviceMetadata httpGetEnabled="true" /> 
      <serviceDebug includeExceptionDetailInFaults="true" /> 
     </behavior> 
     </serviceBehaviors> 
    </behaviors> 
    <services> 
     <service behaviorConfiguration="Consent.Service.SubjectConsentServiceBehavior" 
     name="Consent.Service.SubjectConsentService"> 
     <endpoint address="" binding="basicHttpBinding" bindingConfiguration="default" 
      contract="Consent.Service.ISubjectConsentService"> 
      <identity> 
      <dns value="localhost" /> 
      </identity> 
     </endpoint> 
     <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> 
     </service> 
    </services> 
    </system.serviceModel> 

는 "추가 서비스 참조"와 VS2008에 의해 생성 된 프록시가 MaxBufferSize, maxReceivedMessageSize, maxStringContentLength 및 MaxArrayLength에 대한 증가 된 값을 알 값을 기본값으로 설정합니다.

클라이언트가 기본값을 사용하는 이유는 무엇입니까?

답변

5

서버의 구성 파일에 설정된 값은 웹 서비스의 메타 데이터의 일부로 노출되지 않으므로 (서비스 자체가 아닌 전송 계층과 관련되기 때문에) 클라이언트 (또는이 경우에는 "서비스 참조 추가"기능)은 자동으로 해당 기능을 찾을 방법이 없습니다. ("Add Service Reference"는 WSDL을 요청하고 해당 클래스를 생성하지만 구성 파일의 전송 관련 설정에 액세스 할 수 없습니다.)

이와 같이 두 클래스 모두에서이를 오버라이드해야합니다 클라이언트와 서버.

+0

나는 당신이 옳다고 생각합니다. 나는 과거에이 문제가 없다고 맹세 할 수는 있었지만, 분명히 그 설정을 수동으로 업데이트해야만 할 것입니다. – Jason

관련 문제