收藏
回答

访问服务器地址出现500错误

我的小程序代码

requestWebService: function () {
    
    wx.request({
      url: 'https://www.zttsmartt.com/WebService1.asmx/HelloWorld',
      method: 'POST',
      data: {
      },
      success: function (res) {
        console.log(res)
      },
      fail: function () {
        // fail
      },
      complete: function () {
        // complete
      }
    })
  }


webservice是用c#写的,代码

public class WebService1 : System.Web.Services.WebService
    {
        log4net.ILog log;
        [WebMethod]
        public string HelloWorld()
        {
            log4net.Config.XmlConfigurator.Configure();
            log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
            log.Error("hello");
            return "Hello World";
        }
        [WebMethod]
        public int[] Name(int a, int b)
        {
            return new int[] { a, b };
        }
    }


访问时报500错误


帮我看看错在哪里?我的地址是

https://www.zttsmartt.com/WebService1.asmx


回答关注问题邀请回答
收藏

1 个回答

  • 半寸灰
    半寸灰
    2019-01-08

    你的是网页   。。。不是接口


    自然  data   是 网页内容呗

    2019-01-08
    有用
    回复 2
    • 微笑
      微笑
      2019-01-09

      我的那个是webservice接口啊

      2019-01-09
      回复
    • 吴春浩
      吴春浩
      2019-03-18

      我也是这个问题,请问楼主解决了没

      2019-03-18
      回复
登录 后发表内容