1

IIS7でホストされているWCFサービスがあります(サービスとクライアントの構成はこの投稿の最後にあります)。私は、誰かがそれを攻撃して解決策を見つける方法についていくつかのアイデアを持っているかもしれないと期待していた奇妙なシナリオに遭遇しました。

このサービスは、1つのコントラクト'ProcessMessage'のみを公開します。そのコントラクトを使用して、期待されるパフォーマンスでサービスから同期メッセージを送受信できますが、そのコントラクトへの1つの特定の呼び出しは、65KBを超えるデータを返します。約1MB。最初に呼び出したときに、予想される最大受信サイズ超過エラーを受け取りました。そこで、maxReceivedMessageSizeを増やしました。この特定の呼び出しは、クライアントに戻るのに40分かかります。これは、タイムアウト設定をはるかに超えており、私が期待するものをはるかに超えています。サーバー側の処理時間はわずか2秒です。クライアント側で持ちこたえているようです。

また、ファイル内の他のクォータのいくつかを無駄に増やしてみました。

どんな考えでも大歓迎です。ありがとう。

サービス構成:

  <system.serviceModel>
<services>
  <service behaviorConfiguration="Lrs.Esf.Facade.Startup.FacadeBehavior"
    name="Lrs.Esf.Facade.Startup.FacadeService">
    <endpoint address="" binding="wsHttpBinding" bindingConfiguration="default" contract="Lrs.Esf.Facade.Startup.IFacadeService">
      <identity>
        <servicePrincipalName value="lrsdomain/PensionDev" />
      </identity>
    </endpoint>
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
  </service>
</services>
<bindings>
  <wsHttpBinding>
    <binding name="default">
      <security mode="None"/>
    </binding>
  </wsHttpBinding>
</bindings>
<behaviors>
  <serviceBehaviors>
    <behavior name="Lrs.Esf.Facade.Startup.FacadeBehavior">
      <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
      <serviceMetadata httpGetEnabled="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="true" />

    </behavior>
  </serviceBehaviors>
</behaviors>

クライアント構成:

  <system.serviceModel>
<bindings>
  <wsHttpBinding>
    <binding name="WSHttpBinding_IFacadeService" closeTimeout="00:01:00"
        openTimeout="00:01:00" receiveTimeout="00:1:00" sendTimeout="00:01:00"
        bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
        maxBufferPoolSize="52428800" maxReceivedMessageSize="6553600"
        messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
        allowCookies="false">
      <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647"
          maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
      <security mode="None">          
      </security>
    </binding>
  </wsHttpBinding>
</bindings>
<client>
  <endpoint address="http://esf2.facade.testpe.pg.local/FacadeWcf/FacadeService.svc"
      binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IFacadeService"
      contract="FacadeServiceReference.IFacadeService" name="WSHttpBinding_IFacadeService">
    <identity>
      <servicePrincipalName value="lrsdomain/PensionDev" />
    </identity>
  </endpoint>
</client>

4

2 に答える 2

1

サーバー側のさまざまなパラメーターのサイズを大きくしなかったようです。ぜひ試してみてください。サーバー側のクライアント構成ファイルからのバインディング構成も使用します。サービスはデフォルトで64Kメッセージサイズのままであるため、サービスが停止している可能性があります。

また、receiveTimeoutクライアントバインディングは少しおかしいです-ゼロ桁がありません:

<binding name="WSHttpBinding_IFacadeService" 
receiveTimeout="00:1:00" 

あなたは使用する必要がありますreceiveTimeout="00:01:00"

マーク

于 2009-07-30T16:41:25.137 に答える
0

問題の基本的な原因と回避策を理解しましたが、追加の洞察があれば素晴らしいと思います。

DataSetは、WCFによってXML形式でシリアル化されていました。DataSetをbyte[]としてシリアル化するように強制し、時間を4秒に短縮しました。HTTP通信が有効になるように4MBのXMLのすべての文字をエスケープすることが、問題の原因であると推測されます。

于 2009-07-31T19:11:26.033 に答える