2014-02-11 2 views
0

클라이언트 측에서 처리하는 대신 WCF 서비스 측에서 최대 버퍼 크기를 사용하여 바인딩을 정의하는 방법은 무엇입니까? 이것이 가능한지 누군가가 나에게 알릴 수 있습니까? 나는 클라이언트 측에서 바인딩을 커스터마이즈하고 싶지 않다.서비스 측면의 WCF 바인딩

+0

서버에 적절한 구성 파일을 만듭니다. IIS 내부에서 WCF 서비스를 호스팅하는 경우'web.config'가 필요하며 WCF 서비스를 자체 호스팅하는 경우 호스트 응용 프로그램에 대해'app.config'가 필요합니다. –

답변

0

도움이 될 수 있습니다! maxRequestLength = 214748364Web.Config에 추가하십시오.

<system.web> 
    <compilation debug="true" targetFramework="4.5" /> 
    <httpRuntime targetFramework="4.5" maxRequestLength="2147483647" executionTimeout="300"/>  
</system.web> 

그리고 태그이 추가 작동하지 않는 경우.

<bindings> 
     <webHttpBinding> 
      <binding name="webHttpBG" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" 
maxBufferPoolSize="21474836470" closeTimeout="00:01:00" openTimeout="00:01:00" 
      receiveTimeout="00:10:00" sendTimeout="00:01:00"> 
       <security mode="None"/> 
      </binding> 

     </webHttpBinding> 
    </bindings> 

그리고 당신의 태그

. 이런 식으로하십시오.

<services> 
    <service behaviorConfiguration="" name="Your.Service.Name"> 
    <endpoint address="" behaviorConfiguration="RESTBehavior" binding="webHttpBinding" 
     bindingConfiguration="webHttpBG" contract="Your.Package.IContract" /> 
    <host> 
     <baseAddresses> 
     <add baseAddress="http://localhost:51855/Contract.svc" /> 
     </baseAddresses> 
    </host> 
    </service> 
+0

클라이언트 측에서 바인딩이 아래에 있습니까? <으로 WebHttpBinding> <바인딩 이름 = "webHttpBG"maxReceivedMessageSize = "2147483647"가 MaxBufferSize = "2147483647" maxBufferPoolSize = "21474836470"closeTimeout = "0시 1분 0초"이며 openTimeout = "0시 1분 0초" receiveTimeout = "0시 10분 0초"sendTimeout = "0시 1분 0초"> <보안 모드 = "없음"/> Manoj

+0

아니,이 모든 서버 측이! WCF 프로젝트의 Web.Config 파일을 변경하십시오. –