前端请求可以是对应的本地地址,也可以是发布的webServices地址加方法名
url: "AddApplyOnline.asmx/AddApplyOnlineData",本地地址
url: 'http://192.168.1.48:3030/AddApplyOnline.asmx/AddApplyOnlineData',IIS发布的地址
前端代码示例:
$.ajax({ //ajax post 调用webservice
type: "POST",
contentType: 'application/x-www-form-urlencoded',
url: "AddApplyOnline.asmx/AddApplyOnlineData",
//url: 'http://192.168.1.48:3030/AddApplyOnline.asmx/AddApplyOnlineData',
data: {
UserName: "admin",
PWD: "13579",
DataStr: JSON.stringify({
CustomerName: txtCustomerName,
Address: txtCompanyAddress,
ContactName: txtName,
ContactPhone: txtPhone,
WeChat: txtWechat,
ScopeName: sltField,