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

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

问题描述

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



我是web服务的新手。我想知道如何创建WSDL文件,以及如何使rails应用程序和WSDL文件之间的交互。



如果您认为有更好的选择比SOAP / WDSL,我也想听到他们。



谢谢,


解决方案

你有没有Google搜索如何在Ruby中构建Web服务?这里有几个链接出现,都准确地处理你想要做的:

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



你如何看看其中的一些链接,如果您还有其他问题,请回复我们。



我有一个细节:

lockquote
我的合作伙伴构建了flash
应用程序,他告诉我
flash应用程序通过
WSDL文件进行交互。


这听起来像你的伴侣有一个不完整的了解Flash如何访问远程数据服务。在WSDL中使用SOAP Web服务是一种方法,当然,这里有一些文档, a>。

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

很多人喜欢做的是使用AMF网关和 RemoteObject的。 AMF是一个二进制格式,所以你会得到比替代品来回传输更小的文件大小。它还提供了服务器端对象和客户端对象之间的自动对象转换。这可以节省开发时间,因为您不必解析数据就可以将其转换为Flex可以轻松使用的东西。 RubyAMF 是AMF的一个Ruby实现。

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.

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.

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

Thanks,

Oded

解决方案

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:

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

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.

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.

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.

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

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