您好,我有一个WCF服务,网址不工作,如果我调用一个超过260个字符的变量路径,谁有什么建议吗?
<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>我有IIS 7,它在64位windows server 2008中运行
我正在打开HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\HTTP\Parameters
我右键单击参数,选择新的dword 32位值,我将其命名为
MaxFieldLength (我选择十六进制)输入fffe,它是0x0000fffe (65534)
MaxRequestBytes (我选择十六进制)输入1000000,它是0x0000fffe (16777216)
UrlSegmentMaxLength (我选择十六进制)输入fffe,它是0x001fffff (2097151)
就像在图片https://dl.dropbox.com/u/541519/fb/reg.png中一样
我重新启动服务器,但仍然只能看到260个字符。我做错了什么?
我还打开了iis来设置请求过滤为正确的值(最大url长度的查询字符串->enable设置为2097151,最大查询字符串)
发布于 2012-09-20 00:35:50
您可能可以使用自定义webHttpBinding来解决此问题。
<bindings>
<webHttpBinding>
<binding name="longbinding" maxUrlLength="32766 />
</webHttpBinding>
</bindings>然后将其用于您的端点
<endpoint kind="webHttpEndpoint"
contract="DToolsSynchronizationService.ISyncService"
bindingConfiguration="longbinding"/>您可能需要进一步配置绑定,但这应该是一个开始。
https://stackoverflow.com/questions/12498980
复制相似问题