2012-02-16 6 views
2

최근에 wcf 서비스 호출이 메시지의 처음과 끝 부분에서 메시지의 머리글을 두 번 무작위로 반환하는 문제가 발생했습니다. 다음은 내가 바이올린을 통해보고있는 것의 예입니다.메시지에 중복 된 WCF 헤더

HTTP/1.1 200 OK 
Cache-Control: private 
Content-Type: text/xml; charset=utf-8 
Vary: Accept-Encoding 
Server: Microsoft-IIS/7.5 
X-AspNet-Version: 4.0.30319 
X-Powered-By: ASP.NET 
Date: Thu, 16 Feb 2012 15:48:22 GMT 
Content-Length: 308 

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><Person_UpdateLastCSIDResponse/></s:Body></s:Envelope>HTTP/1.1 200 OK 
Cache-Control: private 
Content-Length: 126 
Content-Type: text/xml; charset=utf-8 
Server: Microsoft-IIS/7.5 
X-AspNet-Version: 4.0.30319 
X-Powered-By: ASP.NET 

이것은 항상 발생하지만 임의로 발생하는 것으로 보입니다. 하나의 특정 서비스 콜에서만 발생하는 것은 아니지만 모든 호출에서 발생할 수 있습니다. 아직 패턴을 식별하지 못했습니다.

Silverlight 응용 프로그램에서로드 밸런서를 통해 바인딩 유형 basicHttpBinding을 사용하고 있습니다.

편집 :

우리가 상당히 기본 구성이 있습니다

서비스 측면 :

<system.serviceModel> 
<extensions> 
    <behaviorExtensions> 
    <add name="silverlightFaults" type="Website.Support.SilverlightFaultBehavior, Website" /> 
    </behaviorExtensions> 
</extensions> 
<behaviors> 
    <serviceBehaviors> 
    <behavior> 
    <serviceMetadata httpGetEnabled="true" /> 
    <serviceDebug includeExceptionDetailInFaults="true" /> 
    </behavior> 
    </serviceBehaviors> 
</behaviors> 
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" 
    multipleSiteBindingsEnabled="true" /> 
<services> 
    <service name="Website.Services.CommonService"> 
    <endpoint address="" behaviorConfiguration="SilverlightFaultBehavior" 
    binding="basicHttpBinding" bindingConfiguration="MyDefaultBinding" 
    contract="Website.Services.CommonService" /> 
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> 
    </service> 
<bindings> 
    <basicHttpBinding> 
    <binding name="MyDefaultBinding" maxBufferSize="6500000" maxReceivedMessageSize="6500000"> 
    <readerQuotas maxDepth="32" maxStringContentLength="52428800" maxArrayLength="52428800" 
     maxBytesPerRead="4096" maxNameTableCharCount="52428800" /> 
    </binding> 
    </basicHttpBinding> 
</bindings> 
<client /> 
</system.serviceModel> 

클라이언트 측 :

<system.serviceModel> 
    <bindings> 
     <basicHttpBinding> 
      <binding name="SecureBinding" maxBufferSize="8388608" maxReceivedMessageSize="8388608"> 
       <security mode="Transport" /> 
      </binding> 
     </basicHttpBinding> 
    </bindings> 

    <client> 
     <endpoint address="https://Website/Services/CommonService.svc" binding="basicHttpBinding" bindingConfiguration="SecureBinding" 
      contract="CommonSvcReference.CommonService" name="BasicHttpBinding_CommonService"/> 
    </client> 
</system.serviceModel> 
+0

서비스 구성을 제공 할 수 있습니까? (' ...'섹션) –

답변

1

나는 결국 내 문제를 해결 한 생각을. 로드 밸런서를 사용하고 있으므로 keep-alive를 false로 설정해야합니다. 문제는 BasicHttpBinding이 keep-alive를 true로 유지한다는 것입니다. customBinding으로 전환하면 연결 유지 기능을 해제 할 수 있으므로 문제가 해결됩니다.

keep-alive를 false로 설정하면 응용 프로그램 속도가 느려집니다. 이 문제를 해결하기 위해 샘플 코드를 사용했습니다. http://blog.tonysneed.com/2012/06/18/building-scalable-and-secure-wcf-services/

관련 문제