SOAP? Why would you use that?
I am using Ruby Enterprise Edition and Rails 3 to write my web application. The application uses Ustream's Watershed white label broadcasting services to provide live streaming for my users. Unfortunately I have hit a snag during development. Watershed allows an application to provide it's own authentication layer through the implementation of a SOAP service on the application side of things. This authentication layer must be implemented in SOAP 1.2 to work with Watershed. To my great dismay, it seems that the Ruby community has moved on past ye'old SOAP towards a brighter future filled with REST and Unicorns.
This makes me happy 99.9% of the time. However right now I need to make a SOAP 1.2 endpoint in my shiny new Rails 3 application.
If anyone has any suggestions or libraries that I can use, I would be very thankful.
Things I have done already
Tried the built in SOAP support in Ruby. Unfortunatly it seems that it does not support SOAP 1.2.
Looked at WSO2 but didn't want to build an extensive set of Ruby extensions on my server just to support SOAP.
Thought about hard-coding xml responses before deciding that I am a lazy programmer.
It's been a while since this Q was posted, but hey, SOAP isn't speeding off either. I guess you've implemented something, care to share?
Anyway, as a kind of answer, I've been blessed with a customer forcing me to consume his SOAP services (their awesome SOA platform doesn't support other formats...) both for pulling and pushing data. I only consume, as I provide nice and clean RESTful Web Services myself for others. I've been using savon (french for soap?) with great success
http://savonrb.com
If you're truly lazy, you'll hard code the SOAP envelope structure and input your dynamic data. Here's a simple example.
def soap_envelope(pCode)
"<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:prod='http://xmlns.aBigCompany.com/path/to/NeededService'>
<soapenv:Header/>
<soapenv:Body>
<something:NeededServiceRequest>
<something:productCode>#{pCode}</something:productCode>
</something:NeededServiceRequest>
</soapenv:Body>
</soapenv:Envelope>"
end
And this is one way to use it
products_wsdl = Savon::Client.new "http://ipAtBigCo:xxxx/path/to/services/NeededService?wsdl"
begin
response = products_wsdl.process! do |soap|
soap.xml = soap_envelope("someProductCode")
end
rescue => e
MyLogger.error "Error: SOAP call for code #{pCode} failed. ++"
raise e
end
response.to_hash # This is the nice part
About SOAP 1.2, savon supports it. About actually being a SOAP service provider, I haven't done it in rails (fight it!) and can only wish you good luck. Having to develop the stupid WSDLs yourself is the real pain with SOAP services. Hope this helps anyone.
If you cannot avoid SOAP in Rails 3, then try wash_out gem. You can find it at: https://github.com/roundlake/wash_out
We used in our system. It is not fool-proof and still undergoing some changes, at least you would get started
Although Rails 3 onwards, they have kind-of stopped supporting SOAP - wash_out gem helps you to get started with creating SOAP webservice faster. Anyone interested should have a look at the wash_out wiki on github. In our case, client wanted a SOAP webservice to be exposed; we tried to go the REST way. In the end, we had to say yes to SOAP. I tried aws, soap4r - but wash_out turned out to be best fit.
You can use this gem for soap implementation
savon
You may find what you are looking for here http://aws.rubyonrails.org/
Related
Is it possible to write soap based web services using ruby on rails framework. If yes, can someone please point to a learning resource
Yes, you can write SOAP web services using Rails, However Rails is moving in favour of a REST web service approach. So my personal opinion is if you are starting a brand new Rails app with SOAP web services, consider some other programming language like JAVA, because that has more tools to easily create SOAP web services.
But nowadays all the webservices going towards REST, because of the simplicity it has. Almost all major sites has a REST API.
Furthermore if you are still planning to go ahead with Rails, savon is an interesting gem that you should probably look at.
I'm trying to integrate a simple Rails app with a BPEL process but it's been hard since BPEL has few or maybe none support for RESTfull web services.
I've tried already using a HTTP binding but i'm not sure if I got what I want since the component moved to the internal side, and it's actually an external service.
So I have two questions:
I needed to write the xsd file to define the request and response xml structure. I searched and it seems there is no gem for doing this automatically. Is there any? Or even better, is there a gem that creates something like a wsdl file? I know this is for SOAP web services and in RESTful there is no such thing, but creating this files by hand is a pain in the ass. So I search something similar.
HTTP binding is the only way I found to call a RESTfull web service. Is there anything better? Has anyone been successful using it? Or code it in Java and use the Java adapter or something would be easier?
Any suggestion, even if not directly for my questions are appreciated. Thanks.
Also if there are some articles about it, links are welcome.
WashOut is a new SOAP server library and definitely worth checking out.
I am new to blackberry app development and was wondering if someone could point me in the right direction(and may be a sample application) of how to consume web service in native apps. I'm using Blackberry JDE plugin for Eclipse.
I am able to consume a restful webservice, but now I want to consume a SOAP service. I am new to eclipse , so I would require in detail information.
Thanks,
I followed this none-ksoap2 route and it worked well for me:
http://www.johnwargo.com/index.php/blackberry/dbja2.html
This series of articles explains how to utilise the support the BlackBerry Platform has built in for JSR 172, the J2ME Web Services Specification, by creating a java stub class through the use of a utility in the Sun Java Wireless Toolkit for CLDC and the wsdl for your web service.
The articles give a very thorough and detailed explanation of the steps required to achieve the objective, so I would not wish to repeat them here in full, nor paraphrase them at the risk of my debased shorter version being quoted later. I understand the risk of answering in this way, and I realise that my short explanation above will in no way compensate should the original articles disappear from the internet.
Hey thanks for all the help. Figured it out. The problem was wcf service. When I tried with a simple web service(.asmx), it worked like charm and all the stubs were generated correctly. Probably wcf uses Soap 1.2 default and asmx service SOAP 1.1.
I even tried using KSOAP2 for calling wcf service with little success. Again switching back to asmx instead of wcf, solved the issue.
Now I have problem of plenty, which method to use(KSOAP or Stub) :)
I am all for non KSOAP method, but the only thing that is stopping me is I have to generated stub files everytime a introduce a new method.
Anyways +1 for all the help
I'm trying to consume a SOAP web service, (from SharePoint 2010 if it makes a difference). I'm using Ruby 1.9 and Rails 3. What is the best way to do this? I've read some stuff mentioning Savon http://savonrb.com/ but that is was too new and buggy. Is it still the best solution? Thanks.
I used Savon successfully to interact with the Bullhorn Staffing SOAP based service about six months ago. I didn't have any problems with the Savon Gem, all my headaches came from inconsistencies with the service.
My interactions with their service was limited to getting data (simple) and pushing data, which could include a resume file (more complex). I didn't have to look much further than the Savon doc to figure everything out, which I thought was simple to understand and easy to apply to my particular set of problems.
TLDR; 1 vote for Savon despite what you may have heard.
I used savon to interact with Jira SOAP API and it worked fine.
Is it possible to integrate MS Outlook/Exchange tasks with Rails? I know how to send emails with Rails, but that isn't using anything "special" about exchange, just pointing it at the server.
What is "special" about an Outlook Task and how I can I create/read/update/delete them from Rails. (Even a subset of CRUD would be great.)
PS. I am on a linux based rails system, so solutions that rely on a windows-only function won't work for me.
If you are running Exchange 2007 you should also look at Exchange web services to manipulate things.
I am in the process of building a MS Exchange client access library in Ruby that uses MS Exchange Web services. The code is GPL'd so have at it. Please let me know what kind of issues you have and what other features you'd like to see. It's pretty heavy in development at this point.
http://github.com/zenchild/Viewpoint
Cheers,
Dan Wanek
WebDAV might be the way to go, if you'd like to do it in Ruby. There is a ruby gem call rexchange that can do the trick. However, MSFT is phasing out WebDAV and replacing it with the Exchange Web Services, which is Zoredache suggested. Unfortunately, MSFT only provides API in C# (technically, it's SOAP stuff that is language-agnostic, some Java developers seem to sucessfully build some stuff using EWS, but I have yet known anyone has done this in Ruby.)
Assuming that the tasks are stored in Exchange, you should be able to access the tasks through WebDAV.