2013-08-01 2 views
1

WCF 서비스에 메서드를 정의했으며 바이트 []을 매개 변수로 사용할 수 있습니다. 함수를 호출하면 오류가 발생합니다. An exception of type 'System.OutOfMemoryException' occurred in System.ServiceModel.ni.dll but was not handled in user code참조 .cs.WCF 서비스 - System.OutOfMemoryException 문제

여기 내용 []를 바이트의 목적 내 코드

svc.GetDataUsingDataContractCompleted += new EventHandler<GetDataUsingDataContractCompletedEventArgs>(svc_GetDataUsingDataContractCompleted); 
svc.GetDataUsingDataContractAsync(contents, "AllImagesZip.zip"); 

이다. 나는 다음과 같습니다. Web.config 파일. 로컬 에서

나는이 서비스를 호스팅 한

<?xml version="1.0"?> 
<configuration> 
<appSettings> 
    <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" /> 
</appSettings> 
<system.web> 
    <compilation debug="true" targetFramework="4.5" /> 
    <httpRuntime targetFramework="4.5" executionTimeout="300" maxRequestLength="409600"/> 
</system.web> 
<system.serviceModel> 
<bindings> 
    <basicHttpBinding> 
    <!--<binding maxReceivedMessageSize="2147483647" maxBufferPoolSize="2147483647" receiveTimeout="00:10:00" closeTimeout="00:10:00"> 
     <security mode="None" /> 
    </binding>--> 
    <binding name="basicHttpsBinding" closeTimeout="01:01:00" 
    openTimeout="01:01:00" receiveTimeout="01:10:00" sendTimeout="01:01:00" 
    allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" 
    maxBufferSize="2147483646" maxBufferPoolSize="2147483646" maxReceivedMessageSize="2147483646" 
    messageEncoding="Mtom" textEncoding="utf-8" transferMode="StreamedRequest" 
    useDefaultWebProxy="true"> 
    <readerQuotas maxDepth="2147483646" maxStringContentLength="2147483646" maxArrayLength="2147483646" 
    maxBytesPerRead="2147483646" maxNameTableCharCount="2147483646" /> 
    <security mode="None"> 
    <transport clientCredentialType="None" proxyCredentialType="None" 
     realm="" />   
    </security> 
</binding>  
    </basicHttpBinding>  
</bindings> 

<behaviors> 
    <serviceBehaviors> 
    <behavior> 
     <!-- To avoid disclosing metadata information, set the values below to false before deployment --> 
     <serviceMetadata httpGetEnabled="true" httpsGetEnabled="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="false"/> 
    </behavior> 
    </serviceBehaviors> 
</behaviors> 
<protocolMapping> 
    <add binding="basicHttpsBinding" scheme="https"/> 
</protocolMapping>  
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" /> 

을 IIS. 내용 개체는 바이트를 포함합니다. 이 문제는 인터넷 연결로 인해 발생한다고 생각하지만 인터넷 연결이 정상적으로 작동합니다. 내가해야 할 일이 무엇이 오류입니까?

답변

1

나는 비슷한 문제가있었습니다. 기억해 보면, WCF 서비스에서 app.xaml 파일을 수정하고 maxpool ... maxpool ...을 부여해야합니다.

Web.Config 파일을 업데이트하고 suh를 최대화 한 것으로 착각했습니다.

maxBufferSize, maxBufferPoolSize 및 기타.

여기를 클릭하십시오 : Large Binary (byte[]) File transfer through WCF

+0

app.xaml에서해야 할 변경 사항은 무엇입니까? –

+0

내 대답 업데이트 됨 – Cheese

+0

"원격 서버에서 예기치 않은 응답을 반환했습니다 : (413) 요청 엔터티가 너무 큽니다."Silverlight에서 서비스가 다른 오류 코드를 보내는 경우에도 404 응답 코드가보고 될 수 있습니다. " 나는 코드를 업데이트했다 –