XML-RPC Call require ssl

Hi,

my App is going to do some calls to a certain website. This website is only under https to reach.

Rigth now I implemented some XML-RPC calls wich are working as long as I develop locally. So I do get a response and everything seems to work.

But if I try it online I always get an error because of missing "openssl"

1) So I tried to install the lib -> not available any more

Does anyone has an idea how I can access to my ssl-secure website calls?

I Just found this video which shows using AsyncHttp   (http://vimeo.com/12216299#) but how can I access real webservice calls ( I can switch to other than xmlrpc)

here is what I did:

def call

    #Make an object to represent the XML-RPC server.

    server = XMLRPC::Client.new2( "https://MY-URL","/xmlrpc.php" , 443)

    # Call the remote server and get our result

    result = server.call("my_xmlwebservide", just_a_number)
   
    name = result['name']
    return name
end

I hope someone has an idea

Evgeny Vovchenko
XML-RPC is not currently

XML-RPC is not currently supported.

You can use AsyncHttp to make any https calls and then parse result:

http://docs.rhomobile.com/rhodes/connect-to-web-services

http://docs.rhomobile.com/rhodes/extensions#ruby-extensions

see XML Handling

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Manuel Stiem
Hi,xmlrpc is not the problem

Hi,

xmlrpc is not the problem ... this works fine. I downloaded an XMLPRC library http://www.ntecs.de/ruby/xmlrpc4r/client.html#label-35 and  added into my /Library/Ruby/Gems/1.8/gems/rhodes-3.3.2/lib/framework folder. I can use it. It works perfect. As long as I use it on port 8082 and not 443. This library supports ssl but rhomobile doesn't have it any more. So I downloaded the openssl extention from https://github.com/rhomobile/rhodes/tree/1.4.0 and pasted it into the extension folder to try to use it for my needs. But what ever I do, can't get it working. I always get the error can't find openssl.

Do you have any Idea how I could get my setup working?

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Evgeny Vovchenko
Openssl contains 2 parts:

Openssl contains 2 parts: openssl.so – with all algorithms implementations and openssl ruby library, which is just wrapper over openssl.so for Ruby

At this moment Rhodes does not support openssl.so, we are going to support it in next release

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Manuel Stiem
Hey, good news! And thanks

Hey,

good news! And thanks for answering both questions (here and in google group). I have seen you imported openssl again into the maaster branch. I will try out and tell how it works! :-)
Thanks a lot for helping in this particular case!!

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Manuel Stiem
Hi, I still have a problem

Hi, I still have a problem with open ssl. I use the former discribed XML-RPC library and downloaded the new OPENSSL extension. I added into the build.yml  "openssl.so" and  "openssl". My client still aks for the openssl.so which is declared in my XML-RPC Client Library.

Error: no such file to load -- openssl<br/>Trace: <br/>
9 /Library/Ruby/Gems/1.8/gems/rhodes-3.3.2/lib/extensions/net-http/net/https.rb:94:in `require'<br/>
10 /Library/Ruby/Gems/1.8/gems/rhodes-3.3.2/lib/extensions/net-http/net/https.rb:94:in `<top (required)>'<br/>
11 /Library/Ruby/Gems/1.8/gems/rhodes-3.3.2/lib/framework/xmlrpc/client.rb:312:in `require'<br/>
12 /Library/Ruby/Gems/1.8/gems/rhodes-3.3.2/lib/framework/xmlrpc/client.rb:312:in `initialize'<br/>
13 /Library/Ruby/Gems/1.8/gems/rhodes-3.3.2/lib/framework/xmlrpc/client.rb:357:in `new'<br/>
14 /Library/Ruby/Gems/1.8/gems/rhodes-3.3.2/lib/framework/xmlrpc/client.rb:357:in `new2'<br/>
15 /Users/manuelstiem/Documents/workspace/rhostudio/pharmasensor prototype/app/Xmlrpc/xmlrpc_controller.rb:67:in `call2'<br/>
16 /Library/Ruby/Gems/1.8/gems/rhodes-3.3.2/lib/framework/rho/rhocontroller.rb:91:in `serve'<br/>
17 /Library/Ruby/Gems/1.8/gems/rhodes-3.3.2/lib/framework/rho/rhoapplication.rb:226:in `serve'<br/>
18 /Library/Ruby/Gems/1.8/gems/rhodes-3.3.2/lib/framework/rho/rho.rb:829:in `serve'

what do I wrong?

cheers Manu

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Jon Tara
You need to explicitly add

You need to explicitly add openssl.so in your build.yml:

extensions:

- openssl.so

- openssl

- digest

- digest-sha1

- digest-sha2

- digest-md5

- zlib

-net-http

(You may not need all of these, but they are commonly used together.)

I've had mixed results. I've been successful with XMPP4R doing TCP streaming with openssl. But net-http fails with https. The server gets requests and sends responses. My Rhodes app never sees the responses. Still looking into it, need to sick a protocol analyzer on it.

Vote: 
Vote up!
Vote down!

Points: 1

You voted ‘up’


Manuel Stiem
Hi Jon,thanks for your advice

Hi Jon,

thanks for your advice. But unfortunally it does not help (yet)

How did you integrate your "XMPP4R" library into your app? I tried the following way:

1) added the xmlrpc library into the folder:

/Library/Ruby/Gems/1.8/gems/rhodes-3.3.2/lib/framework/

-> xmlrpc works for Iphone but just http not https  ----is it possible to integrate this Ruby library like an extension ( insert extension folder into app root and copy the folder ito it, and add in the build.yml "xmlrpc"--

and now I tried to add openssl:

1) added extensions:

- openssl.so

- openssl

- digest

- digest-sha1

- digest-sha2

- digest-md5

- zlib

-net-http

but the now the nett-https is looking for openssl and can't find it:

Error: no such file to load -- openssl<br/>Trace: <br/>
9 /Library/Ruby/Gems/1.8/gems/rhodes-3.3.2/lib/extensions/net-http/net/https.rb:94:in `require'<br/>
10 /Library/Ruby/Gems/1.8/gems/rhodes-3.3.2/lib/extensions/net-http/net/https.rb:94:in `<top (required)>'<br/>
11 /Library/Ruby/Gems/1.8/gems/rhodes-3.3.2/lib/framework/xmlrpc/client.rb:312:in `require'<br/>
12 /Library/Ruby/Gems/1.8/gems/rhodes-3.3.2/lib/framework/xmlrpc/client.rb:312:in `initialize'<br/>
13 /Library/Ruby/Gems/1.8/gems/rhodes-3.3.2/lib/framework/xmlrpc/client.rb:357:in `new'<br/>
14 /Library/Ruby/Gems/1.8/gems/rhodes-3.3.2/lib/framework/xmlrpc/client.rb:357:in `new2'<br/>
15 /Users/manuelstiem/Documents/workspace/rhostudio/pharmasensor prototype/app/Xmlrpc/xmlrpc_controller.rb:67:in `call2'<br/>
16 /Library/Ruby/Gems/1.8/gems/rhodes-3.3.2/lib/framework/rho/rhocontroller.rb:91:in `serve'<br/>
17 /Library/Ruby/Gems/1.8/gems/rhodes-3.3.2/lib/framework/rho/rhoapplication.rb:226:in `serve'<br/>
18 /Library/Ruby/Gems/1.8/gems/rhodes-3.3.2/lib/framework/rho/rho.rb:829:in `serve'   

any idea?

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Jon Tara
1. You can incorporate

1. You can incorporate extensions into your app instead of into the framework. I would recommend that. You need to create an extensions directory at the top-level:

my_app

  app

  bin

  extensions

    xmlrpc

  icon

  public

  .

  .

2. I am using Rhodes 3.4.2, which already has openssl incorporated. I don't have any problem with openssl not found. But I also can't confirm yet that net-http actually works with https. My server gets the connection and sends a response, but the response is never received in my Rhodes app. It works for http.

3. Unrelated, but I'd recommend you use rvm instead of just loading your Ruby and Gems in /Library. This way, you can manage multiple Ruby Versions and multiple sets of Gems, so that you can easily switch between different Rhodes versions.

Vote: 
Vote up!
Vote down!

Points: 1

You voted ‘up’


Manuel Stiem
Hi, I already added the two 

Hi,

I already added the two  librarys but I do get erros

what do I wrong?

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Jon Tara
Did you put xmlrpc in your

Did you put xmlrpc in your extension in your build.yml?

I have a feeling that you are still going to have a problem, though, once you get this loaded, because SSL support in net-http does appear to be broken. But interested in finding out if you have any more luck.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Jon Tara
I've confirmed that net-http

I've confirmed that net-http https doesn't work on iOS:

https://github.com/rhomobile/rhodes/issues/90

This isn't why your're having trouble loading xml-rpc, but just a heads-up that it ain't gonna work once you do get it to load.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Manuel Stiem
Hi, I didn't take a seperate

Hi, I didn't take a seperate gem. I just took the Ruby library whis is in core for using the calls. I just had to patch the webrick library ...because I just needed one function. There were a couple dependcies I ereased with

... so you say https does not work with net-http - bad!

... oh and I added xmlrpc and webrick extension in my build.yml

-> stilll have no idea why it doesn't find openssl

I hope they gonna fix this issue soon

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Jon Tara
Sorry, yes, I missed that you

Sorry, yes, I missed that you are using the XML-RPC that is in the standard Ruby library.

Did you solve the problem with "no such file to load"? Every extension needs to be mentioned in the build.yml extension list, as well as the "require" statement.

Curious why you need Webrick? It seems to me you could do about anything you can do with Webrick with Rhode's internal server. Just set a fixed port in rhoconfig.txt if you need some external device to access the server.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Manuel Stiem
Hi, first I need webrick for

Hi, first I need webrick for the cookie which is called in xmlrpc/client.erb. So I have to use it.

first I need to fix the "no such file to load"

I do not have an idea why I get the error "Error: no such file to load -- xmlrpc/client"

here is what I did:

1) added the two librarys in the extension folder

2) added in build.yml xmlrpc and webrick

3) didn't change the require statement - still    require 'xmlrpc/client'

4) tried to delete the statement but then I get this error:

Error: undefined method `faultCode' for #<NameError: uninitialized constant XmlrpcController::XMLRPC

crazy

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Log in to post comments