嗨,我想创建一个示例Web服务,我是新手,但是当我运行我的Web服务程序时,出现以下错误。 。其他详情如下 -HTTP错误403.14 - 禁止在Windows 7上使用Visual Studio 12创建Web服务
我的AssemblyInfo.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
namespace MyFirstWebService
{
/// <summary>
/// Summary description for Service1
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
// [System.Web.Script.Services.ScriptService]
public class Service1 : System.Web.Services.WebService
{
[WebMethod]
public string simpleMethod(String srt)
{
return "Hello " + srt;
}
[WebMethod]
public int anotherSimpleMethod(int firstNum, int secondNum)
{
return firstNum + secondNum;
}
}
}
当我运行此我得到
下面是我的Windows快照功能的服务 -
我的IIS设置如:
我跑以下命令我CMD %WINDIR%\微软.NET \ Framework \ v4.0.30319 \ aspnet_regiis.exe -ir
请告诉我如何摆脱这一点。
我收到以下错误时,我给http:// localhost:50383/simpleMethod.aspx '/'应用程序中的服务器错误。 无法找到该资源。 描述:HTTP 404.您正在查找的资源(或其某个依赖项)可能已被删除,名称已更改或暂时不可用。请检查以下网址并确保它拼写正确。 请求的网址:/simpleMethod.aspx 版本信息:Microsoft .NET Framework版本:4.0.30319; ASP.NET版本:4.0.30319.17929 你能告诉我如何把默认文件? – 2013-02-16 13:18:34
谢谢你,你救了我 – JkAlombro 2017-09-28 12:19:25