为什么部署然后运行asmx服务会引发500错误?

时间:2019-04-23 07:37:09

标签: c# asp.net web-services iis asmx

我在webservice中有一个asmx。我将其托管到IIS 7.0中的Default Web Site,但是浏览时会引发错误。

  

HTTP错误500.19,代码为0x80070021

此外,在IIS中扩展文件夹后,即使文件夹中也有web.config.asmx文件,也不会显示。

Image

文件夹内部视图:

Image 2

Web服务代码:

namespace Plant_WebService
{
    /// <summary>
    /// Summary description for EngineeringData
    /// </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 EngineeringData : System.Web.Services.WebService
    {

        [WebMethod]
        public string HelloWorld()
        {
            return "Hello World";
        }

        [WebMethod]
        public bool InsertEngineeringData(string FunctionalLocation, string EqptType, string WINFileNo, string ComponentTagNo)
        {
            bool Status = false;

            EngineeringDataDAL EngineeringDataDAL = new Vail_PlantWebApi.EngineeringDataDAL();

            Status = EngineeringDataDAL.InsertEngineeringData(FunctionalLocation, EqptType, WINFileNo, ComponentTagNo);

            return Status;
        }
    }
}

0 个答案:

没有答案