如何创建一个网络服务 [英] how to create a web service

查看:25
本文介绍了如何创建一个网络服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 Ruby on Rails 框架构建了一个网站.该站点将包含一个 flash 应用程序,该应用程序将使用 Web 服务与 rails 应用程序进行交互.我的合作伙伴构建了 Flash 应用程序,他告诉我 Flash 应用程序通过 WSDL 文件进行交互.

I building a website with Ruby on Rails framework. The site will contain a flash application that will interact with the rails application using web service. My partner builds the flash application and he told me that the flash application interacts through WSDL file.

我是网络服务的新手.我想知道如何创建WSDL文件,以及如何进行rails应用程序和WSDL文件之间的交互.

I am new to web services. I would like to know how to create the WSDL file, and how to make the interaction between the rails application and the WSDL file.

如果您认为有比 SOAP/WDSL 更好的替代方案,我也想听听他们的意见.

If you believe that there are better alternatives than SOAP/WDSL, I would like to hear them too.

谢谢,

奥德

推荐答案

您是否在 Google 上搜索过 如何在 Ruby 中构建 Web 服务?下面是一些出现的链接,所有链接都准确地解决了您想要做的事情:

Have you Googled how to build web services in Ruby? Here are a few links that come up, all addressing exactly what you want to do:

http://www.tutorialspoint.com/ruby/ruby_web_services.htm

http://www.ibm.com/developerworks/opensource/library/os-ws-rubyrails/index.html

http://searchsoa.techtarget.com/tip/Web-services-with-Ruby-on-Rails

您看看其中的一些链接如何,如果您有进一步的问题,请返回给我们.

How about you take a look at some of those links, and come back to us if you have further questions.

我确实有一个详细说明:

I do have one elaboration:

我的搭档制作了闪存申请,他告诉我flash 应用程序交互通过WSDL 文件.

My partner builds the flash application and he told me that the flash application interacts through WSDL file.

听起来您的合作伙伴对 Flash 如何访问远程数据服务并不完全了解.使用带有 WSDL 的 SOAP Web 服务当然是一种方法,这里有一些 相关文档一>.

It sounds like your partner has an incomplete understanding of how Flash can access remote data services. Using a SOAP Web Service with a WSDL is one method, for sure, and here is some documentation on that.

Flex/Flash 应用程序还可以进行标准 HTTP 调用,有时称为 REST Web 服务.在许多情况下,REST Web 服务将返回一个 XML 文档,但这不是必需的.任何数据,包括简单的文本数据,都可以从 REST Web 服务返回.

A Flex / Flash application can also make standard HTTP calls, sometimes called REST Web Services. In many cases, REST Web Services will return an XML Document, but that is not required. Any data, including simple text data, can be returned from a REST Web Service.

许多人更喜欢使用带有 RemoteObject<的 AMF 网关/a>.AMF 是一种二进制格式,因此与替代方案相比,来回传输的文件大小要小得多.它还提供服务器端对象和客户端对象之间的自动对象转换.这可以节省开发时间,因为您无需解析数据即可将其转换为 Flex 可以轻松使用的内容.RubyAMF 是 AMF 的一种 Ruby 实现.

What many people prefer to do is to use an AMF Gateway with RemoteObject. AMF is a binary format so you'll get much smaller file size transferred back and forth than the alternatives. It also provides for automatic object translation between your server side objects and client side objects. This can be a time saver in development because you don't have to parse data to turn it into something Flex can use easily. RubyAMF is one Ruby implementation of AMF.

这篇关于如何创建一个网络服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆