I am not an expert of SOAP and WSDL but I have Perl code which I would like to port to R.
The Perl code looks like this (from https://www.pharmgkb.org/resources/downloads_and_web_services.jsp):
use SOAP::Lite;
import SOAP::Data 'type';
sub main {
my $argcount = scalar (@ARGV);
if ($argcount != 1) {
print "usage: diseases.pl <PharmGKB accession id>\n";
exit -1;
}
# make a web services call to server
my $call = SOAP::Lite
-> readable (1)
-> uri('PharmGKBItem')
-> proxy('http://www.pharmgkb.org/services/PharmGKBItem')
-> searchDisease($ARGV[0]);
if ($call->fault) {
print $call->faultcode . ": " . $call->faultstring . "\n";
} else {
my $result = $call->result;
The read things about rsoap and SSOAP packages but did not get any nice info. What I need is full support, such as call the service and provide libraries to parse the output. I prefer some libraries rather then raw coding. I am good with XML package and not very good with RCurl. I am correct in thinking that there is no good and current (actively maintained) support in R for this?
Typically, you start from WSDL to build your web service if you want to implement a web service that is already defined either by a standard or an existing instance of the service.
WSDL is an XML file that defines and describes the services that are available in the web service of interest. It describes the naming of services, the specifications and structure of the response sent back. The services in the WSDL are described as a compilation of network ports/endpoints.
To call a Web service programmaticallyUse the Web reference name (or server name) as the namespace, and the name of its . WSDL file (or the service name) as the proxy class. The following code example calls a Web service method to get a string value. Web service variable names and syntax are highlighted.
Checkout the SSOAP package on OmegaHat. It's compatible with both S and R. It even has an genSOAPClientInterface
function for generating the available Operations in the WSDL as R functions and generating the associated S4 classes for all of your data types described in the WSDL. It leverages XML and RCurl (both of which were created by the same author). He provides a directory full of examples and pretty useful PDF documentation.
I had a few problems with it when using my WSDL (and am still using modified code to get it to work), but the author of the package is extremely helpful and responsive to bug reports, if you run into issues.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With