2012-07-27 5 views
0

제 3 자 호스팅 웹 서비스에서 수십만 개의 항목을 다운로드해야합니다. 웹 서비스를 사용하면 웹 서비스 호출 당 최대 2,000 개의 엔티티를 가져올 수 있지만 실제로는 더 많은 레코드를 호출 할 때 간헐적 인 오류로 인해 한 번에 50-75 개 엔티티 만 끌어낼 수있었습니다. 문제가 제 편으로 조정해야하는지 또는 문제가 제 3 자 웹 서비스 공급자와 관련이 있는지 여부를 결정하려고합니다. 여기에 오류가 나타날 것 : https://some.vendor.com/API/SomeService.svc에 HTTP 응답을받는 동안큰 요청에 대한 WCF SOAP 오류

오류가 발생했습니다. 이는 HTTP 프로토콜을 사용하지 않는 서비스 끝점 바인딩 때문일 수 있습니다. 또한 (서비스가 종료되었을 수 있으므로) 서버에서 HTTP 요청 컨텍스트를 중단해야 할 수 있습니다. 자세한 내용은 서버 로그를 참조하십시오 ( ). 응용 프로그램 구성이 바인딩에서 볼 수 있듯이

<system.serviceModel> 
    <bindings> 
     <customBinding> 
      <binding name="SomeService"> 
       <security defaultAlgorithmSuite="Default" authenticationMode="UserNameOverTransport" 
        requireDerivedKeys="true" securityHeaderLayout="Strict" includeTimestamp="true" 
        keyEntropyMode="CombinedEntropy" messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10"> 
        <localClientSettings cacheCookies="true" detectReplays="false" 
         replayCacheSize="900000" maxClockSkew="00:05:00" maxCookieCachingTime="Infinite" 
         replayWindow="00:05:00" sessionKeyRenewalInterval="10:00:00" 
         sessionKeyRolloverInterval="00:05:00" reconnectTransportOnFailure="true" 
         timestampValidityDuration="00:05:00" cookieRenewalThresholdPercentage="60" /> 
        <localServiceSettings detectReplays="false" issuedCookieLifetime="10:00:00" 
         maxStatefulNegotiations="128" replayCacheSize="900000" maxClockSkew="00:05:00" 
         negotiationTimeout="00:01:00" replayWindow="00:05:00" inactivityTimeout="00:02:00" 
         sessionKeyRenewalInterval="15:00:00" sessionKeyRolloverInterval="00:05:00" 
         reconnectTransportOnFailure="true" maxPendingSessions="128" 
         maxCachedCookies="1000" timestampValidityDuration="00:05:00" /> 
        <secureConversationBootstrap /> 
       </security> 
       <textMessageEncoding maxReadPoolSize="64" maxWritePoolSize="16" 
        messageVersion="Soap11" writeEncoding="utf-8"> 
        <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" 
         maxBytesPerRead="4096" maxNameTableCharCount="16384" /> 
       </textMessageEncoding> 
       <httpsTransport manualAddressing="false" maxBufferPoolSize="2147483647" 
        maxReceivedMessageSize="2147483647" allowCookies="false" authenticationScheme="Anonymous" 
        bypassProxyOnLocal="false" decompressionEnabled="true" hostNameComparisonMode="StrongWildcard" 
        keepAliveEnabled="true" maxBufferSize="2147483647" proxyAuthenticationScheme="Anonymous" 
        realm="" transferMode="Streamed" unsafeConnectionNtlmAuthentication="false" 
        useDefaultWebProxy="true" requireClientCertificate="false" /> 
      </binding> 
     </customBinding> 
    </bindings> 
    <client> 
     <endpoint address="https://secure.Some.com/API/1.2/Service.svc" 
      binding="customBinding" bindingConfiguration="SomeService" 
      contract="SomeService.SomeService" name="SomeService" /> 
    </client> 
</system.serviceModel> 

, 나는 2147483647에 maxBufferPoolSize, maxReceivedMessageSize 및 해당 MaxBufferSize 증가 다음

웹 서비스 바인딩에 대한 내 응용 프로그램 구성 설정의 사본입니다 또한 transferMode를 Streamed로 변경했습니다.

+0

당신은 클라이언트 또는 중 (시간 초과 문제를 타격 할 수 서버 종료) ... 요청이 시작될 때 오류가 발생하기까지 얼마나 걸립니까? 완료하는 데 너무 많은 시간이 걸리는 많은 양의 데이터를 요구했기 때문에 서버가 시간 초과되어 연결을 종료 할 확률이 높습니다. 귀하가 통제 할 수있는 제 3 자 웹 사이트가 없으면 타이밍을 변경할 수 없습니다. 제 시간에 50 개의 레코드를 배치 할 수 있습니까? 타임 아웃 옵션에서 이것을보십시오. http://www.lybecker.com/blog/2010/10/14/wcf-timeouts/ –

+0

스트리밍을 사용하는 경우 IIS에서 제한을 늘려야합니다. http://stackoverflow.com/questions/6030137/large-binary-byte-file-transferthrough-wcf –

+0

웹 서비스가 호출 될 때 밀리 초 이내에 실패하기 때문에 시간 초과 문제라고 생각하지 않습니다. 더 작은 데이터 집합을 요청하면 성공하지만 1 ~ 2 초 이상 걸릴 수 있습니다. –

답변

0

행동을 추가하여 설정할 수있는 또 다른 중요한 설정이 있습니다 : 엔드 포인트를 업데이트

<behaviors> 
    <endpointBehaviors> 
    <behavior name="SomeBehavior"> 
     <dataContractSerializer maxItemsInObjectGraph="2147483647" /> 
    </behavior> 
    </endpointBehaviors> 
</behaviors> 

다음은 :

<client> 
    <endpoint address="https://secure.Some.com/API/1.2/Service.svc" 
    binding="customBinding" bindingConfiguration="SomeService" 
    contract="SomeService.SomeService" name="SomeService" 
    **behaviorConfiguration="SomeBehavior"**/> 
</client> 
+0

조언 해 주셔서 감사합니다. 이 변경을 시도했지만 여전히 동일한 오류가 발생합니다. –