Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Consume a web service in R

Here's the scenario:

I have JBoss serving a web service with JBossWS providing me with a wsdl. I have connected and used it from both .NET and Java so far (and it has been quite easy once I figured it out). I am now trying to do the same with R.

Is there anything out there considered to be "the right way" for doing this? I am not that familiar with R, and my searches have not turned up much, so I figured I'd ask and maybe spare my head and the wall a bit of damage.

like image 411
caseyboardman Avatar asked Dec 21 '10 21:12

caseyboardman


2 Answers

I have had good luck using rJava to recreate in R something that works in Java. I use this method for connecting to Amazon's AWS Java SDK for their API with R. This allows me, for example, to transfer files to/from S3 from R without having to recreate the whole connection/handshake/boogieWoogie from R.

If you wanted to go more "pure R" I think you'll have to use some combination of RCurl and the XML package to grab and parse the wsdl.

like image 171
JD Long Avatar answered Sep 22 '22 14:09

JD Long


There are a number of ways:

  • You could retain your Java approach and use the rJava package around it

  • You could use RCurl which is used to power a few higher-level packages (accessing Google APIs, say)

  • I believe there is an older SSOAP package on Omegahat which may help too.

like image 31
Dirk Eddelbuettel Avatar answered Sep 19 '22 14:09

Dirk Eddelbuettel