【问题标题】:Vuejs soap clientVuejs 肥皂客户端
【发布时间】:2019-01-27 13:18:07
【问题描述】:

我正在考虑将一个项目转移到 Vuejs,并且我已经创建并测试了很多 .net soap webservices。我知道我可以使用 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) {

   }
});

【问题讨论】:

    标签: soap vue.js


    【解决方案1】:

    是的,您可以通过 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 - 带有扩展示例和 SOAP 良好示例的 axios 文档是此链接: https://stackoverflow.com/a/49153096/5808830

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-08-11
      • 2017-09-27
      • 2013-04-03
      • 2017-07-04
      • 1970-01-01
      相关资源
      最近更新 更多