The perl SOAP client enables an easy integration of the SWAMP server into remote applications. It can be downloaded here either as SUSE RPM or source tarball. After installing the perl module "SUSE::Swamp" should be useable from within your perl scripts. To view the module documentation please use:
perldoc SUSE::Swamp |
#!/bin/bash -i $WSDL='http://<swamp.server>:8080/axis/services/swamp?wsdl' perl -I. -MSUSE::Swamp -e"print SUSE::Swamp->new('$WSDL')->generateDoc()" | pod2man --name="SWAMP SOAP API" | nroff -man | less; |
A complete example script on how to use the module is included in its distribution. Usage looks like this:
#!/usr/bin/perl use strict; use SUSE::Swamp; my $url = 'http://<swamp.url>:8080/axis/services/swamp?wsdl'; my $username = "swamp_user"; my $pwd = "swamp"; my $swamp = SUSE::Swamp->new($url); my $version = $swamp->doGetProperty( "SWAMP_VERSION", $username, $pwd ); print "SWAMP server version: " . $version . "\n"; # create a workflow: my $wfid = $swamp->createWorkflow( 0, "Example", $username, $pwd ); print "Created workflow with id: $wfid" . "\n"; # read data from the workflow my $result = $swamp->doGetData( $wfid, "testdataset.reason", $username, $pwd ); print "Value of testdataset.reason: $result" . "\n"; |