0

Hello I have a WCF service The url does nto work if i call with a path more than 260 characters variable Does anyone have any suggestions?

<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>

I have IIS 7 which runx in 64 bit windows server 2008

I am openning [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\HTTP\Parameters]

I right click on parameters select new dword 32 bit value I name it to

MaxFieldLength (I select hexadecimal) enter fffe which is 0x0000fffe (65534)

MaxRequestBytes (I select hexadecimal) enter 1000000 which is 0x0000fffe (16777216)

UrlSegmentMaxLength (I select hexadecimal) enter fffe which is 0x001fffff (2097151)

as it is in image https://dl.dropbox.com/u/541519/fb/reg.png

I restart the server and still I only see up to 260 characters. What am i doing wrong

I have also opened iis to set request filtering to correct values (query string ->enable settings 2097151 for max url length, max query string)

user1573406
  • 31
  • 1
  • 4
  • This post might help you http://stackoverflow.com/questions/8245843/how-do-i-increase-the-maxurllength-property-in-the-config-in-asp-net-mvc-3 – Christian Haaland May 23 '13 at 08:53

1 Answers1

-2

You can probably solve this using a custom webHttpBinding.

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

And then use it for your endpoint

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

You may need to configure the binding further, but this should be a start.

Jordan Kaye
  • 2,837
  • 15
  • 15