#/usr/bin/perl -w use strict; open FILE1,"+>>log.txt" or die $1; # remove the +trace => all to remove extensive output HTTP/SOAP traces use SOAP::Lite +trace => 'all'; #use MIME::Entity; # instantiate a soap client object my $soap = SOAP::Lite -> uri('https://ws3.sticomputer.com/LabVendorWeb/LabVendor.asmx') -> on_action( sub { '"'.join('/', 'http://sticomputer.com/lab', $_[1]).'"' } ) -> proxy('https://ws3.sticomputer.com/LabVendorWeb/LabVendor.asmx'); # call the Ping() method print "Calling Ping...\n"; print $soap->Ping()->result; print "done.\n"; # call the HelpAbout() method print "Calling HelpAbout...\n"; my $result = $soap->HelpAbout(); print $result->valueof('//HelpAboutResult' )."\n"; print "done.\n"; my @files = <*.hl7>; foreach my $file (@files){ print "Calling PutFile....\n"; my $method = SOAP::Data->name('PutFile') ->attr({xmlns => 'http://sticomputer.com/lab'}); my $fileContents = ""; open( LABFILE,"<$file" ); while( <LABFILE> ) { $fileContents .= $_; }; close ( LABFILE); my @params = ( SOAP::Data->name('vendorID' => 'xxxx'), SOAP::Data->name('vendorPassword' => 'xxxx'), SOAP::Data->name('fileData' => $fileContents) ); my $return = $soap->call($method => @params)->result; <big><code>die $return->faultstring if ($return->fault);</code></big> print $return->result, "\n"; } print "done.\n";
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)