`
sean_gao
  • 浏览: 227818 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

[Tips] Ruby调用WebServices(SOAP)

阅读更多

昨天试用一个WebService,需要确定是否正确安装配置,用Ruby来做真的很方便,一个本来在Java中颇为麻烦的事,到了Ruby(irb)里面,变得很简单。你要做的,就是打开irb,依次敲入以下代码:

ruby 代码
 
  1. require 'soap/wsdlDriver'      
  2. URL = 'http://somedomain/someapp/somewsdl'    
  3. soap_client = SOAP::WSDLDriverFactory.new(URL).create_rpc_driver  


接下来就可以直接通过soap_client访问这个WebService的方法了,如:

ruby 代码
  1. soap_client.version  
  2. soap_client.get_user_roles('user')  


如果你指定

ruby 代码
  1. soap_client.wiredump_file_base = 'log_file'  


系统还能帮你记录在使用WebService接口时所有发出和收到的xml消息。
分享到:
评论

相关推荐

    building restful web services with spring 5 2e

    Building RESTful Web Services ...Comply with the best ways to test RESTful web services, including tips for load testing Optimise and scale web services using techniques such as caching and clustering

    Mastering Go Web Services

    Effectively deploy and integrate Go web services with applications in the real worldFamiliarize yourself with RESTful practices and apply them in GoA comprehensive tutorial with lots of tips and ...

    《20 tips to empower your story》——欧美PPT公司soap新作.rar

    标题中的“《20 tips to empower your story》——欧美PPT公司soap新作.rar”揭示了一个重要的信息,即这是一款由欧美专业PPT设计公司SOAP推出的新的作品,名为“20 tips to empower your story”。这个标题暗示了...

    abap tips abap tips

    abap tips abap tips abap tips abap tips abap tips

    Go Web Programming (PDF, EPUB, MOBI)

    You'll learn how to implement the dependency injection design pattern for writing test doubles, use concurrency in web applications, and create and consume JSON and XML in web services. Along the way...

    Tips基于jQuery的提示框插件可自动消失可手动消失

    在jQuery的$(document).ready()函数内,调用`.tips()`方法,并传递必要的参数。例如,要创建一个自动消失的提示,可以这样做: ```javascript $(document).ready(function() { $('.element').tips({ content: '这...

    一个显示Tips对话框的例子

    然后在对应的事件处理函数中调用显示Tips的方法。 4. **自定义Tips**:虽然大多数编程环境提供了默认的Tips样式,但有时我们可能需要自定义Tips的外观,如字体、颜色、图标等。这通常需要创建自定义的Tips类,覆盖...

    jQuery_Tips_插件

    然后,可以通过调用jQuery选择器和`.tips()`方法来应用插件: ```javascript $(document).ready(function() { $('.element-to-show-tip').tips(); }); ``` 这里的`.element-to-show-tip`是你希望添加提示效果的...

    jquery tips提示插件自适应屏幕宽度提示图片信息

    3. 初始化插件:在JavaScript中,调用$.fn.tips()函数来初始化插件,并设置参数,如提示内容、触发事件、提示位置等。 4. 配合HTML元素:为需要添加提示的元素添加特定的class或data属性,以便插件识别并执行相应的...

    Swift tips Swift 开发者必备的tips

    9. **可选链式调用**:Swift的可选链式调用允许开发者在安全地访问可能为nil的对象属性或方法,避免了强制解包可能导致的运行时错误。 10. **协议与扩展**:Swift 4.0的协议可以包含默认实现,扩展则允许为已有类型...

    ABAP Tips

    - **SOAP和RESTful服务**:ABAP支持创建和消费这些类型的Web服务。 - **RFC(Remote Function Call)**:SAP系统间的通信协议,也可用于与外部系统交互。 9. **开发工具与调试** - **SAP GUI**:标准的桌面...

    jquery.tips.js

    * $(selector).tips({ //selector 为jquery选择器 * msg:'your messages!', //你的提示消息 必填 * side:1, //提示窗显示位置 1,2,3,4 分别代表 上右下左 默认为1(上) 可选 * color:'#FFF', //提示文字色 默认...

    Web_Dynpro_for_ABAP_Tips_and_Tricks

    在IT领域,特别是针对SAP ABAP环境下的Web Dynpro应用开发,有一份详尽的知识宝典《Web Dynpro for ABAP Tips and Tricks》显得尤为珍贵。这份文档由经验丰富的开发者编写,旨在分享他们在实际项目中积累的最佳实践...

    Lua Performance Tips.rar

    "Lua Performance Tips"这份文档深入探讨了如何通过遵循一些编程准则和技巧来提升Lua程序的执行效率。以下是对这些要点的详细解析: 1. **理解Table的运作机制** Lua中的Table是其核心数据结构,用于实现数组、...

    100 COOL MAINFRAME TIPS

    如何将Mainframe与分布式系统(如Linux、Windows或Unix)进行集成,使用Web Services或APIs,以及通过MQ(Message Queuing)实现异步通信,这些都可能是"COOL TIPS"中的一部分。 最后,成本效率和资源利用率的提升...

    wxPython Grid Tips and Tricks

    wxPython Grid Tips and Tricks

Global site tag (gtag.js) - Google Analytics