Dear All,
I have written a ruby class which uses the flickr webservice. When I
wrote a "command line" sript using that class the I get a proper
response (through res_message). But when I use the class in a
controller I get nil as the response
any help will be highly appreciated.
thanks.
J
--------------------------------------
class is like this.
class FlickrClient
def initialize(key)
@key = key
end
def query(text)
payload = compile_query(text)
@client = WSMyClient.new(Hash[:to => "http://api.flickr.com/
services/soap"])
res_message = @client.request(payload)
return "Res Message : " << res_message.to_s
rescue => exception
return "Exception : #{exception}"
end
private
def compile_query(text)
payload = <<XML
<x:FlickrRequest xmlns:x="urn:flickr">
<method>flickr.photos.search</method>
<api_key>#{@key}</api_key>
<text>#{text}</text>
</x:FlickrRequest>
XML
return payload
end
end
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
This may not directly answer your question, but take a look at the following link on NetBeans site. Amongst other links, it has one that demonstrates how to integrate flickr in Ruby on Rails. Most of it should apply to what you are trying to do. http://www.netbeans.org/kb/60/ruby/'' HTH. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
thanks.
I have tested the same (my) code with Webrick it works fine. With
apache I am not getting the result as expected. It seems like the
function does not wait until the result is recieved, moving to next
line and execute it.
For the same Webrick gives a result to res_message. Apache just return
nil. please note that I am using a web service engine using c called
through WSMyClient.
Does anybody have a clue?
@client = WSMyClient.new(Hash[:to => "http://api.flickr.com/
services/soap"])
res_message = @client.request(payload)
regards,
J
On Oct 18, 6:11 pm, Bharat
<bcrupa...-/E1597aS9LQAvxtiuMwx3w@public.gmane.org>
wrote:> This may not directly answer your question, but take a look at the
> following link on NetBeans site. Amongst other links, it has one that
> demonstrates how to integrate flickr in Ruby on Rails. Most of it
> should apply to what you are trying to
do.http://www.netbeans.org/kb/60/ruby/''
> HTH.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---