`
lichangwei
  • 浏览: 74902 次
  • 性别: Icon_minigender_1
  • 来自: 苏州
社区版块
存档分类
最新评论

JavaScript SOAP Client

    博客分类:
  • soap
阅读更多
A lot of talking about AJAX is taking place here and there; AJAX is the acronym of "Asynchronous JavaScript and XML", a technology based on XMLHttpRequest, which is now supported by all main browsers. The basic idea is quite simple - and not actually a breakthrough - but it allows updating a page following a server request, without reloading the entire set of data.

We propose a solution based on AJAX that has a great advantage with respect to those commonly found in Internet: calls are made to the Web Services.

This permits:


On the server side we only have to expose a Web Service with the required methods (instead of generating dynamic pages incorporating data that are based on a custom syntax or on a generic XML)
On the client side we use the WSDL (Web Service Description Language) to automatically generate a JavaScript proxy class so as to allow using the Web Service return types - that is similar to what Visual Studio does when a Web Reference is added to the solution.

The following diagram shows the SOAP Client workflow for asynchronous calls:



The Client invokes the SOAPClient.invoke method using a JavaScript function and specifying the following:


Web Service URL (pls note that many browsers do not allow cross-domain calls for security reasons)
Web method name
Web method parameter values
Call mode (async = true, sync = false)
CallBack method invoked upon response reception (optional for sync calls)

The SOAPClient.invoke method executes the following operations (numbers refer to the previous diagram)


It gets the WSDL and caches the description for future requests
It prepares and sends a SOAP request to the server (invoking method and parameter values)
It processes the server reply using the WSDL so as to build the corresponding JavaScript objects to be returned
If the call mode is async, the CallBack method is invoked, otherwise it returns the corresponding object
  • 大小: 10.6 KB
分享到:
评论

相关推荐

    JavaScriptSoapClient

    JavaScript SoapClient 是一种在Web浏览器环境中使用JavaScript与远程Web服务进行通信的方法。Web服务通常遵循SOAP(简单对象访问协议)标准,这是一种基于XML的消息传递协议,用于在不同系统之间交换结构化信息。...

    JavaScriptSOAPClient_demo.zip

    这个“JavaScript SOAP Client_demo.zip”压缩包包含了一个JavaScript实现的SOAP客户端的演示,可以帮助开发者理解如何在前端环境中调用远程SOAP服务。 在JavaScript中创建一个SOAP客户端并不像在某些服务器端语言...

    Titanium中SOAPClient访问SOAP协议的WebService

    本篇文章将深入探讨如何在Titanium中使用SOAPClient来访问SOAP协议的Web服务。 首先,理解SOAP的基本概念至关重要。SOAP是一种轻量级、文本基础的协议,用于在Web上交换结构化的和类型化的信息。它基于HTTP协议,...

    js-soap-client:JavaScript SOAP 客户端

    Javascript SOAP 客户端从分叉并由 gtathub 修改。改进解析异常已修复数组作为参数正确设置类型定义中的长度属性如果 wsdl 中未列出数组,也会从响应中解析它们理解来自 php webservice 的响应(例如 Magento) 兼容...

    easysoap源码包

    soapClient.call('MethodName', {param1: 'value1', param2: 'value2'}, (err, res) => { if (err) { console.error(err); } else { console.log(res.body); // SOAP响应的解析结果 } }); ``` 从提供的压缩包...

    cakephp + jira soap client的使用

    4. JSON(JavaScript Object Notation):这是一种轻量级的数据交换格式,易于人阅读和编写,同时也易于机器解析和生成。在RESTful API中,JSON经常被用作数据交换的格式。 本例中,我们将通过PHP代码使用cURL来...

    JavaScript 调用wsdl示例

    JavaScript调用WSDL(Web Service Definition Language)是Web服务客户端编程的一个重要方面,尤其是在需要与SOAP(Simple Object Access Protocol)服务交互时。本示例主要介绍如何在JavaScript中使用不同的库和...

    Aspnet-soap-client.zip

    Aspnet-soap-client.zip,使用web服务(手动处理)-xml到json[restapi]soap客户端,asp.net是一个开源的web框架,用于使用.net构建现代web应用和服务。asp.net创建基于html5、css和javascript的网站,这些网站简单、...

    ng-soap:Javascript SOAP客户端(http

    **ng-soap:JavaScript SOAP 客户端** `ng-soap` 是一个专门针对JavaScript环境设计的SOAP(简单对象访问协议)客户端库,它为Web服务的调用提供了便利。SOAP是一种基于XML的协议,用于在分布式环境中交换结构化和...

    关闭页面[removed]事件未执行的原因及解决方法

    例如,当`logout()`调用了一个名为`SOAPClient.invoke()`的异步方法时,如果在等待服务器响应的过程中用户关闭了页面,那么`logout()`函数可能无法完整执行。 2、问题原因: 问题的核心在于`SOAPClient.invoke()`...

    easysoap:一个简单易用的SoapClient for Node.js

    易皂easysoap是用于Node.js的WSDL SoapClient。支持如何获得 ? 用npm安装npm i easysoap用法得到一个soapclient实例const EasySoap = require('easysoap');const soapClient = EasySoap(params, opts); 参数...

    Node.js-node.js的SOAP客户端和服务器

    soap.createClient(wsdlUrl, function(err, client) { if (err) throw err; client.MyMethod(args, function(err, result) { console.log(result); }); }); ``` 对于SOAP服务器,你需要定义服务的处理函数,并...

    as3-soap-client:简单的 AS3 SOAP 客户端

    AS3-SOAP-Client是针对ActionScript 3(AS3)编程语言的一个开源库,主要目的是为了方便在Flash环境中创建SOAP(Simple Object Access Protocol)客户端。SOAP是一种基于XML的协议,常用于Web服务,允许应用程序通过...

    使用JavaScript调用WebService的示例

    此外,还有一些库,如jQuery的$.ajax(),或更专门的库如SoapClient.js,可以帮助简化这个过程。 在实际开发中,确保对目标WebService的WSDL有充分理解,以便正确构造SOAP请求。同时,考虑跨域问题,因为JavaScript...

    史陶比尔soap通讯代码版

    7. **非C#环境下的SOAP库**:由于不是使用C#,你需要熟悉目标编程语言中的SOAP库,如Python的suds-jurko库、Java的JAX-WS或者JavaScript的SoapClient库。 8. **API探索**:描述中提到API功能还有待发掘,这意味着...

    跨域WebService请求-Nginx_SOAP服务_Ajax客户端.docx

    因为JavaScript的同源策略不允许跨域POST请求,所以直接从Ajax客户端调用跨域的SOAP服务是不可能的。 【Nginx反向代理】为了解决这个问题,Nginx作为一个反向代理服务器可以被用来作为中间层,将客户端的请求转发到...

    webctrl_client 文件

    这种设计模式的优势在于,用户无需安装额外的客户端软件,只需要一个支持JavaScript的现代浏览器即可进行操作,大大提升了灵活性和可访问性。 webctrl_client 可能包含以下几个关键知识点: 1. **远程管理**:...

    使用CXF实现带header的soap服务

    在`frontend/client`或`frontend/server`的拦截器链中添加自定义拦截器,拦截器可以访问并处理Message对象中的header信息。 5. **创建客户端**:对于测试或集成,你可能需要创建一个CXF客户端,同样可以配置拦截器...

    soap相关文件

    在本压缩包中,包含两个关键文件"client"和"server",这通常代表了SOAP客户端和服务端的实现。 在Web服务中,"跨域同步"是一个重要的概念。由于浏览器的安全策略,JavaScript通常不能在不同的源之间执行请求,除非...

    RichClient简介以及如何启用RichClient项目

    而与服务器的通信则可以利用各种协议,如SOAP、RESTful API或者直接使用WebSocket进行实时通信。 **Struts2框架与富客户端** Struts2是一个流行的Java开源MVC(模型-视图-控制器)框架,用于构建Web应用。虽然...

Global site tag (gtag.js) - Google Analytics