使用wsHtpBinding帮助页面创建wcf服务时出错,服务也不起作用
帮助页错误
找不到资源。描述: HTTP 404。您正在寻找的资源(或其依赖项之一)可能已被删除、名称更改或暂时不可用。请检查以下URL并确保其拼写正确。http://localhost:80/Service1.svc/help
我以前的工作wsHttpbinding项目web.config,但现在不起作用了:
web.config
<?xml version="1.0"?>
<configuration>
<appSettings>
<add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" executionTimeout="3600" maxRequestLength="10000000"/>
<customErrors mode="Off" />
</system.web>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="MyServiceTypeBehaviors">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
</behavior>
<behavior name="">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<wsHttpBinding >
<binding name="MyBasicwsHttpBinding">
<security mode="None">
<transport clientCredentialType="None" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<services>
<service behaviorConfiguration="MyServiceTypeBehaviors" name="WcfService1.Service1">
<endpoint address="mex" binding="wsHttpBinding" bindingConfiguration="MyBasicwsHttpBinding" name="WcfService1.Service1" contract="WcfService1.IService1"/>
</service>
</services>
<serviceHostingEnvironment minFreeMemoryPercentageToActivateService="0" aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
<directoryBrowse enabled="true"/>
</system.webServer>
</configuration>发布于 2017-03-03 13:22:26
在我的例子中,我发现在IIS /网站上安装了一个Microsoft过滤模块Url扫描3.1,它有自己的限制,根据内容大小拒绝传入的请求并返回"404 Not页面“。
它的限制可以在%windir%\System32\inetsrv\urlscan\UrlScan.ini文件中通过将MaxAllowedContentLength设置为所需的值来更新。
就像。以下将允许最多300 mb的请求
MaxAllowedContentLength=314572800
https://stackoverflow.com/questions/40689733
复制相似问题