首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >WCF服务wsHttpBinding

WCF服务wsHttpBinding
EN

Stack Overflow用户
提问于 2016-11-19 05:59:59
回答 1查看 203关注 0票数 0

使用wsHtpBinding帮助页面创建wcf服务时出错,服务也不起作用

帮助页错误

找不到资源。描述: HTTP 404。您正在寻找的资源(或其依赖项之一)可能已被删除、名称更改或暂时不可用。请检查以下URL并确保其拼写正确。http://localhost:80/Service1.svc/help

我以前的工作wsHttpbinding项目web.config,但现在不起作用了:

web.config

代码语言:javascript
复制
<?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>
EN

回答 1

Stack Overflow用户

发布于 2017-03-03 13:22:26

在我的例子中,我发现在IIS /网站上安装了一个Microsoft过滤模块Url扫描3.1,它有自己的限制,根据内容大小拒绝传入的请求并返回"404 Not页面“。

它的限制可以在%windir%\System32\inetsrv\urlscan\UrlScan.ini文件中通过将MaxAllowedContentLength设置为所需的值来更新。

就像。以下将允许最多300 mb的请求

MaxAllowedContentLength=314572800

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/40689733

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档