Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/wcf/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
wcf服务maxUrlLength maxQueryStringLength maxRequestLength_Wcf_Iis_Service - Fatal编程技术网

wcf服务maxUrlLength maxQueryStringLength maxRequestLength

wcf服务maxUrlLength maxQueryStringLength maxRequestLength,wcf,iis,service,Wcf,Iis,Service,您好,我有一个WCF服务,如果我使用超过260个字符的路径变量调用,url不起作用。有人有什么建议吗 <system.web> <compilation debug="true" targetFramework="4.0" /> <httpRuntime maxUrlLength="32766" maxQueryStringLength="2097151" maxRequestLength="2097151" requestValidationMode="2.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位windows server 2008中运行的IIS 7

我正在打开[HKEY\U LOCAL\U MACHINE\SYSTEM\CurrentControlSet\services\HTTP\Parameters]

我右键单击参数,选择新的dword 32位值,并将其命名为

MaxFieldLength I选择十六进制输入fffe,即0x0000fffe 65534

MaxRequestBytes我选择十六进制输入1000000,即0x0000fffe 16777216

UrlSegmentMaxLength I选择十六进制输入fffe,即0x001fffff 2097151

正如它的形象

我重新启动服务器,但仍然只能看到多达260个字符。我做错了什么


我还打开了iis,将请求筛选设置为更正值query string->enable settings 2097151 for max url length,max query string

您可能可以使用自定义webHttpBinding解决此问题

<bindings>
    <webHttpBinding>
        <binding name="longbinding" maxUrlLength="32766 />
    </webHttpBinding>
</bindings>
然后将其用于端点

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

您可能需要进一步配置绑定,但这应该是一个开始。

在绑定标记中没有名为maxUrlLength的属性,是否有人可以帮助a了解如何定义绑定这篇文章可能会帮助您