IIS 发布RESTFUL服务所遇问题解决办法

本文档解决了IIS配置错误导致的HTTP 500.19内部服务器错误及HTTP 404.3未找到的问题。针对.NET未正确注册的情况提供了详细的注册步骤,并给出了配置文件中关于WCF服务的支持方案。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

错误摘要

1 HTTP 错误500.19 -Internal Server Error

无法访问请求的页面,因为该页的相关配置数据无效。

详细错误信息

模块 IIS Web Core
通知 BeginRequest
处理程序 尚未确定
错误代码 0x80070021
配置错误 不能在此路径中使用此配置节。如果在父级别上锁定了该节,便会出现这种情况。锁定是默认设置的(overrideModeDefault="Deny"),或者是通过包含 overrideMode="Deny" 或旧有的 allowOverride="false" 的位置标记明确设置的。
配置文件 \\?\C:\program file\i.Timex TAMX\webtamsCht \web.config
请求的 URL http://127.0.0.1:80/

物理路径 C:\program file\i.Timex TAMX\webtamsCht
登录方法 尚未确定
登录用户 尚未确定
配置源
82:         </modules>
83:         <handlers>
84:             <remove name="WebServiceHandlerFactory-Integrated" />

出错原因:安装了IIS之后没有注册.NET

解决办法:安装IIS后注册.NET(这里注册IIS支持.net编译)

进dos  打开C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727

方法: cd  C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727

aspnet_regiis     -i

 

2 Server Error in Application "Default Web Site/DotNetNuke_IWeb"

HTTP Error 404.3 - Not Found

Description: The page you are requesting cannot be served because of the Multipurpose Internet Mail Extensions (MIME) map policy that is configured on the Web server. The page you requested has a file name extension that is not recognized, and is not allowed.

Error Code: 0x80070032

Notification: ExecuteRequestHandler

Module: StaticFileModule

Requested URL: http://localhost:80/DotNetNuke_IWeb/DesktopModules/IWebCF/CoreService.svc

Physical Path: C:\Users\Documents\Visual Studio 2005\Projects\IWeb\Website\DesktopModules\IWebCF\CoreService.svc

Logon User: Anonymous

Logon Method: Anonymous

Handler: StaticFile

Most likely causes:

  • It is possible that a handler mapping is missing. By default, the static file handler processes all content.
  • The feature you are trying to use may not be installed.
  • The appropriate MIME map is not enabled for the Web site or application. (Warning: Do not create a MIME map for content that users should not download, such as .ASPX pages or .config files.)
To resolve this(使得IIS支持WCF):

1) Select "run" from the Start menu
Image
2) Enter "cmd" and click OK

Image(1)

3) enter "cd c:\windows\Microsoft.Net\Framework\v3.0\Windows Communication Foundation\" and press Enter.

Image(2)

4) Enter "ServiceModelReg -i" and press Enter.

Image(3)

5) WCF will now be installed:

Image(4)

Also see:

http://blogs.msdn.com/davidwaddleton/archive/2007/11/02/wcf-and-404-3-errors.aspx

 

3 使用“UriTemplate”的终结点无法用于“System.ServiceModel.Description.WebScriptEnablingBehavior”。

于是检查web.config

 <behaviors>
    <endpointBehaviors>
    <behavior name="V6.WebApp.wcf.ServiceAspNetAjaxBehavior">
      <enableWebScript/>     
    </behavior>
    </endpointBehaviors>
</behaviors>

把 <enableWebScript/>换成<webHttp/>,解决!

转载于:https://www.cnblogs.com/ssor/archive/2011/03/30/1999685.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值