#Read the file my $value = read_file( $attachmentFilename , binmode => ':raw', scalar_ref => 1 ); my @params = ( $header, SOAP::Data->name(fileName => $attachFilename), SOAP::Data->name(taskDataContent => encode_base64($$value)), #base64 encode the file contents SOAP::Data->name(results => $results)); #Call the webservice with SOAP::Lite $returnResult = $soap->call($ptrMethod => @params);