2014-05-14 1 views
2

내가하고 실행 데이터 서비스를 가지고,하지만 난이 오류를 받고 있어요 :EF와 함께 WCF 데이터 서비스 (하나로, OData) 내가 설정 설정 파일을 어떻게 6

The remote server returned an error: (413) Request Entity Too Large.

나는 여러 가지를 시도했다 행운과 함께 이것을 고치기. 웹 사이트의 uploadReadAheadSize와 IIS의 데이터 서비스를 최대 설정으로 설정했습니다. 또한 설정 파일에 대해 여러 가지 설정을 시도했습니다.

다음은 클라이언트에 대한 현재의 app.config입니다 :

<system.serviceModel> 
<bindings> 
    <basicHttpBinding> 
    <binding name="BasicHttpBinding_ILogging" /> 
    <binding name="WCFHttpBinding" 
      maxReceivedMessageSize="2147483647" 
      maxBufferSize="2147483647" 
      maxBufferPoolSize="2147483647"> 
     <readerQuotas maxArrayLength="2147483647" 
        maxDepth="2147483647" 
        maxBytesPerRead="2147483647" 
        maxNameTableCharCount="2147483647" 
        maxStringContentLength="2147483647"/> 
    </binding> 
    </basicHttpBinding> 
    <webHttpBinding> 
    <binding name="WCFWebBinding" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647"> 
     <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/> 
    </binding> 
    </webHttpBinding> 
</bindings> 
<client> 
    <endpoint address="http://localhost/PSIDataService/PSIWcfDataService.svc" 
      binding="webHttpBinding" bindingConfiguration="WCFWebBinding" 
      name="WCFWebBinding" contract="*"/> 
</client> 

둘 다 바인딩, WCFWebBinding 및 WCFHttpBinding을 시도했습니다.

다음은 웹 서비스 web.config입니다.

<system.serviceModel> 
<behaviors> 
    <serviceBehaviors> 
    <behavior name=""> 
     <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" /> 
     <serviceDebug includeExceptionDetailInFaults="true" /> 
    </behavior> 
    </serviceBehaviors> 
</behaviors> 
<bindings> 
    <basicHttpBinding> 
    <binding name="WCFHttpBinding" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text"> 
     <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /> 
    </binding> 
    </basicHttpBinding> 
    <webHttpBinding> 
    <binding name="WCFWebBinding" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647"> 
     <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/> 
    </binding> 
    </webHttpBinding> 
</bindings> 
<client> 
    <endpoint address="http://localhost/PSIDataService/PSIWcfDataService.svc" 
     binding="basicHttpBinding" 
     bindingConfiguration="WCFHttpBinding" 
     name="WCFHttpBinding" 
     contract="*"/> 

</client> 

는 다시, 나는 두 바인딩을 시도했습니다. 나는 그 밖의 무엇이 할 수 있는지 모른다. 어떤 도움이라도 좋을 것입니다.

답변

4

이 문제에 대한 해결책을 찾았습니다. 서비스가 있어야의 Web.config는 이름 서비스 덧붙였다과 (속성을

<system.serviceModel> 
<services> 
    <service name="PSIDataService.PSIWcfDataService"> 
    <endpoint bindingConfiguration="msgSize" 
       address="" 
       binding="webHttpBinding" 
       contract="System.Data.Services.IRequestHandler"/> 
    </service> 
</services> 

내 시스템이 서비스의 이름과 계약 모두에 대해 불평 "System.Data.Services.IRequestHandler"로 설정 계약을 맺고 잘못된 경고입니다.) 내 서비스의 네임 스페이스는 PSIDataService이고 클래스 이름은 PSIWcfDataService이므로 불만 사항을 무시했습니다. 계약 이름에도 같은 경고가있었습니다. 인터페이스가 존재한다는 것을 알았 기 때문에 경고도 무시했습니다.

webHttpBinding도 필요합니다.

<bindings> 
    <basicHttpBinding> 
    <binding name="BasicHttpBinding_ILogging" /> 
    </basicHttpBinding> 
    <webHttpBinding> 
    <binding name="msgSize" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647"/> 
    </webHttpBinding> 
</bindings> 

나는 Malvin 리 (malvinly.com/2011/05/09/wcf-data-services-and-maxreceivedmessagesize) 그래서 감사 Malvin에서이 수정에 대한 생각이있어! 나는 경고를 좋아하지 않지만 이것이 나의 문제를 해결했다.

+0

감사합니다. 나는 어제 하루 종일이 일을 망쳤다. 이게 내 문제를 해결했습니다. –