WebService() {
let url = '';
let targetNamespace = '';
let targetMethod = '';
let xmlData = '' //请求的xml数据
wx.request({
url: url,
data: xmlData,
method: 'POST',
header: {
// 'token': getApp().globalData.token,
'content-type': 'text/xml; charset=utf-8',
// 注意:在SOAP 1.2规范中,SOAPAction header这个属性被"action"所取代,但其作用和工作原理都没有变化。
'SOAPAction': targetNamespace + targetMethod
},
success: response => {
let res = response.data
console.log(res)
},
fail() {},
complete() {}
})
}
2021-09-20 微信小程序WebService调用接口
最新推荐文章于 2024-04-20 00:09:24 发布