#!/usr/bin/perl -I /local/share/perl/5.8.2 use SOAP::Lite; use LWP::Protocol::http; use strict; # this is the input file containing the descriptions, one by line my $descriptionFile = "./apj_614.desc"; # we need to declare where the WSDL of the service is located my $service = SOAP::Lite->service("http://cdsws.u-strasbg.fr/axis/services/UCD?wsdl"); my $description; my $result; local *FF; # we open the file containing the descriptions open (FF, $descriptionFile) || die "*** Error opening file!"; while () { # we read one description in the file, in the variable $description $description = $_; # we remove trailing '\n' chop($description); # we call the Web Service to assign the UCD, and store the result in $result eval { $result = $service->assign("$description"); }; if ( $@ ) { # Check for errors my $status = $service->transport()->status(); print "Transport Status: " . $status . "\n"; print "Error: $@"; exit; } # and we print the original description with the result print "$description | $result"; } close (FF);