Parse.com 与 WSDL 通信

编程入门 行业动态 更新时间:2024-10-28 21:23:36
本文介绍了Parse 与 WSDL 通信的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

是否有可能在云代码中调用WSDL"方法?

Is there any possibility to call "WSDL" method in cloud code ?

例如,有一个WSDL"网络服务,我想检查其中是否有新数据,如果有,我想向用户发送推送通知.我明白了逻辑,但我在 parse 文档中找不到任何关于WSDL"的信息.

for example, there is a "WSDL" web service and i want to check if there is an new data in it and if there is i want to send push notification to user. I got the logic, but i could not find any information about "WSDL" in parse documentation.

这没有帮助:

Parse.Cloud.httpRequest({
  url: 'https://services.rs.ge/WayBillService/WayBillService.asmx',
  params: {
    su : 'test1'
  },
  success: function(httpResponse) {
    console.log(httpResponse.text);
  },
  error: function(httpResponse) {
    console.error('Request failed with response code ' + httpResponse.status);
  }
});

推荐答案

当然可以,现在,首先我们需要弄清楚一些事情.

Sure you can, now, first we need to get a few things straight.

WSDL 只是服务的定义Web 服务描述语言"

WSDL is just the definition of the services "Web Services Description Language"

您在这里谈论的是 SOAP简单对象访问协议"

You are talking SOAP here "Simple Object Access Protocol"

如果你去https://services.rs.ge/WayBillService/WayBillService.asmx 在您的浏览器中,您将看到可用的方法/SOAPAction 列表,如果单击它们,您将看到如何调用该方法的示例.

If you go to https://services.rs.ge/WayBillService/WayBillService.asmx in your browser, you will se a list of methods/SOAPActions that are available to you and if you click them, you will see an example of how to call the method.

例如,get_server_time、https://services.rs.ge/WayBillService/WayBillService.asmx?op=get_server_time

For example, get_server_time, https://services.rs.ge/WayBillService/WayBillService.asmx?op=get_server_time

示例如何调用 get_server_time:

Example how to call get_server_time:

Parse.Cloud.job('soap', function(request, status) {
    var Buffer = require('buffer').Buffer,
        buffer = new Buffer(
            '<?xml version="1.0" encoding="utf-8"?>' +
            '<soap12:Envelope xmlns:xsi="http://www.w3/2001/XMLSchema-instance" xmlns:xsd="http://www.w3/2001/XMLSchema" xmlns:soap12="http://www.w3/2003/05/soap-envelope">' +
            '   <soap12:Body>' +
            '       <get_server_time xmlns="http://tempuri/" />' +
            '   </soap12:Body>' +
            '</soap12:Envelope>'
        );

    Parse.Cloud.httpRequest({
        method: 'POST',
        url: 'https://services.rs.ge/WayBillService/WayBillService.asmx',
        headers: {
            'Content-Type': 'text/xml; charset=utf-8'
        },
        body: buffer,
        success: function(httpResponse) {
            status.success(httpResponse.text);
        },
        error: function(httpResponse) {
            status.error('Request failed with response code ' + httpResponse.status);
        }
    });
});

这篇关于Parse 与 WSDL 通信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-24 22:49:57,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1072511.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:通信   Parse   WSDL

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!