I have a mashup I need to d with a site that uses xmlrpc. I am trying to understand the the call method. I have the following items that need to be passed to the remote site. methodName and the following structure ID - string area - string views = array of strings I know what the xml should look like <methodCall> <methodName>lists</methodName> <params> <param> <value> <struct> <member> <name>id</name> <value> <string>12345</string> </value> </member> <member> <name>list</name> <value> <string>district</string> </value> </member> <member> <name>View</name> <value> <array> <data> <value> <string>Ocean</string> </value> <value> <string>Mountain</string> </value> <value> <string>Golf Course</string> </value> <value> <string>Garden View</string> </value> </data> </array> </value> </member> </struct> </value> </param> </params> </methodCall> I have results from various inputs from the view for the value. I am trying to figure out how to create the xml structure and how to use it in the XMLRPC call. Any help? Don French --~--~---------~--~----~------------~-------~--~----~ 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 groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
erb. Set up a boilerplate file and fill in what you need. It''s MUCH faster than trying to generate it with REXML. On Mon, Feb 23, 2009 at 6:57 PM, Don French <dhf0820-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > I have a mashup I need to d with a site that uses xmlrpc. I am trying > to understand the the call method. I have the following items that > need to be passed to the remote site. > > methodName > and the following structure > ID - string > area - string > views = array of strings > > I know what the xml should look like[...lots of xml...]> > I have results from various inputs from the view for the value. I am > trying to figure out how to create the xml structure and how to use it > in the XMLRPC call.--~--~---------~--~----~------------~-------~--~----~ 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 groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
OK I can do that, but how is that result string of xml passed to the server I have a variable remote_server that was created with the XMLRPC::Client.new2 call. how do I then call the method "search" on that serve? Don French On Feb 23, 5:03 pm, Sarah Mei <sarah...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> erb. Set up a boilerplate file and fill in what you need. It''s MUCH > faster than trying to generate it with REXML. > > > > On Mon, Feb 23, 2009 at 6:57 PM, Don French <dhf0...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > I have a mashup I need to d with a site that uses xmlrpc. I am trying > > to understand the the call method. I have the following items that > > need to be passed to the remote site. > > > methodName > > and the following structure > > ID - string > > area - string > > views = array of strings > > > I know what the xml should look like > [...lots of xml...] > > > I have results from various inputs from the view for the value. I am > > trying to figure out how to create the xml structure and how to use it > > in the XMLRPC call.--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Why not require ''xmlrpc/client'' @server = XMLRPC::Client.new((secure) ? MY_SECURE_URN : MY_URN, MY_ENDPOINT, nil, nil, nil, nil, nil, secure) @server.call(''my.method.name'', {:id => 1, :area => ''someplace''} etc. I''ve had nothing but good results from xmlrpc. Any reason not to use it? On Feb 23, 2009, at 7:03 PM, Sarah Mei wrote:> > erb. Set up a boilerplate file and fill in what you need. It''s MUCH > faster than trying to generate it with REXML. > > On Mon, Feb 23, 2009 at 6:57 PM, Don French <dhf0820-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> >> I have a mashup I need to d with a site that uses xmlrpc. I am trying >> to understand the the call method. I have the following items that >> need to be passed to the remote site. >> >> methodName >> and the following structure >> ID - string >> area - string >> views = array of strings >> >> I know what the xml should look like > [...lots of xml...] >> >> I have results from various inputs from the view for the value. I am >> trying to figure out how to create the xml structure and how to use >> it >> in the XMLRPC call. > > >--~--~---------~--~----~------------~-------~--~----~ 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 groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I access 3rd party software through xmlrpc calls. I built mine as a plugin... but i''ll extract some of it for you in this example below: require "xmlrpc/client" def api_perform(class_type, method, *args) begin server = XMLRPC::Client.new3({''host'' => @api_url, ''path'' => "/api/ xmlrpc", ''port'' => 443, ''use_ssl'' => true}) result = server.call("#{class_type}.#{method}", @api_key, *args) rescue XMLRPC::FaultException => e puts "*** Error: #{e.faultCode} - #{e.faultString} ***" end return result end The result that''s returned is a Hash. Hope this helps. --~--~---------~--~----~------------~-------~--~----~ 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 groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thank you. I assume the args parameter is a hash of the variou values to be put into the XML. Correct? Does the call method actually generates the XML as I described, or do I have to generate it? Don French On Feb 24, 6:26 am, nateleavitt <nateleav...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I access 3rd party software through xmlrpc calls. I built mine as a > plugin... but i''ll extract some of it for you in this example below: > > require "xmlrpc/client" > > def api_perform(class_type, method, *args) > begin > server = XMLRPC::Client.new3({''host'' => @api_url, ''path'' => "/api/ > xmlrpc", ''port'' => 443, ''use_ssl'' => true}) > result = server.call("#{class_type}.#{method}", @api_key, *args) > rescue XMLRPC::FaultException => e > puts "*** Error: #{e.faultCode} - #{e.faultString} ***" > end > > return result > end > > The result that''s returned is a Hash. > > Hope this helps.--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---