Vuejs soap client



我正在考虑将一个项目迁移到 Vuejs,我已经创建和测试了很多 .net soap 网络服务。我知道我可以使用 axios 与 REST 网络服务进行交互,但我可以使用 vue 的 .net soap 网络服务吗?我已经找到了,我找不到任何合适的东西......知道吗?

基本上我需要在不使用jquery的情况下替换这段代码:

$.ajax({type: 'POST', url: webservice_url , data: data_to_send, 
contentType: 'application/json; charset=utf-8', dataType: 'json',
success: function (response) {
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
}
});

是的,您可以通过 Axios 从 Vue 与 Soap 进行交互。

您的代码将如下所示:

axios({
method: 'post',
url: webservice_url,
data: data_to_send
})
.then(function (response) {
console.log(response);
})
.catch(function (error) {
console.log(error);
});

https://github.com/axios/axios - 带有扩展示例的 axios 文档和 SOAP 的良好示例是此链接: https://stackoverflow.com/a/49153096/5808830

最新更新