Displaying 4 results from an estimated 4 matches for "find_product_by_id".
2006 Feb 20
3
Trouble connecting to a Rails SOAP web service with a simple Ruby client
...0/ProductBackend/invoke
I''m trying to write a plain ruby command line client to access the webservice.
require ''soap/rpc/driver''
proxy = SOAP::RPC::Driver.new("http://localhost:3000/product_backend",
"urn:ActionWebService")
proxy.add_method(''find_product_by_id'', ''id'')
puts "Product: #{proxy.find_product_by_id(2).name}"
I also tried http://localhost:3000/ProductBackend
I see the following
$ ruby client.rb
/usr/local/lib/ruby/1.8/soap/streamHandler.rb:270:in `send_post'': 404:
Not Found (SOAP::HTTPStreamErro...
2006 Apr 10
2
using web service for authenitcation
...current web apps itself.
I found one method in AWDR, and was:
class MyController < ApplicationController
web_client_api :product,
:soap,
"http://my.app.com/backend/api"
def list
@products = product.find_all_products.map do |id|
product.find_product_by_id(id)
end
end
end
but this is again like invoking the service from outside..
2005 May 31
2
Rails Web Services
...#39;'ve also tried this by using an earlier gem version of rails
(0.12.1, instead of the current 0.12.1.1337 beta gem)
<code>
# app/api/product_api.rb
class ProductApi < ActionWebService::API::Base
api_method :find_all_products,
:returns => [[:int]]
api_method :find_product_by_id,
:expects => [:int],
:returns => [Product]
end
# app/controllers/backend_controller.rb
class BackendController < ApplicationController
wsdl_service_name ''Backend''
web_service_api ProductApi
web_service_scaffold :invoke
def find_al...
2006 Apr 17
7
Should Perl talk to Rails via LWP
Hi folks,
I need your opinions on a basic design issue.
I''ve seen the light of RoR and have replaced my Perl (DBI/CGI) based web
server <-> RDBMS communication with RoR, but I still have a whole host
of users (other servers/OS''s etc) out there wanting to talk to my
RDBMS and they only talk Perl. Also they don''t want to talk Perl/DBI
directly (they are not allowed