我的小程序代码
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
你的是网页 。。。不是接口
自然 data 是 网页内容呗
我的那个是webservice接口啊
我也是这个问题,请问楼主解决了没