0

こんにちは私はWCFサービスを持っています260文字を超える変数のパスで呼び出すとURLが機能しません誰か提案はありますか?

<system.web>
<compilation debug="true" targetFramework="4.0" />
<httpRuntime maxUrlLength="32766" maxQueryStringLength="2097151" maxRequestLength="2097151" requestValidationMode="2.0" relaxedUrlToFileSystemMapping="true" />
<customErrors mode="Off"/>
 </system.web>
 <system.serviceModel>
<bindings>
</bindings>
<behaviors>
  <serviceBehaviors>
    <behavior>
      <!-- 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>
<services>
    <service name="DToolsSynchronizationService.SyncService">
    <endpoint kind="webHttpEndpoint"
    contract="DToolsSynchronizationService.ISyncService" />
  </service>
</services>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>

私は64ビットWindowsServer2008でrunxを実行するIIS7を持っています

[HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ services \ HTTP\Parameters]を開いています

パラメータを右クリックして、新しいdword32ビット値を選択します。

MaxFieldLength(16進数を選択)は、0x0000fffe(65534)であるfffeを入力します

MaxRequestBytes(16進数を選択)は、0x0000fffe(16777216)である1000000を入力します

UrlSegmentMaxLength(16進数を選択)は、0x001fffff(2097151)であるfffeを入力します

画像にあるようにhttps://dl.dropbox.com/u/541519/fb/reg.png

サーバーを再起動しても、最大260文字しか表示されません。私は何が間違っているのですか

また、iisを開いて、要求フィルタリングを正しい値に設定しました(クエリ文字列->最大URL長、最大クエリ文字列の設定2097151を有効にする)

4

1 に答える 1

-2

おそらく、カスタム webHttpBinding を使用してこれを解決できます。

<bindings>
    <webHttpBinding>
        <binding name="longbinding" maxUrlLength="32766 />
    </webHttpBinding>
</bindings>

そして、それをエンドポイントに使用します

<endpoint kind="webHttpEndpoint"
    contract="DToolsSynchronizationService.ISyncService" 
    bindingConfiguration="longbinding"/>

バインディングをさらに構成する必要があるかもしれませんが、これは最初のステップです。

于 2012-09-19T16:35:50.380 に答える