This was quite a while ago and I don't remember the details.

But here is a basic script that you can start with...

Warning: this code is adapted and untested.

use strict; use warnings; use SOAP::Lite +trace => "all"; use MIME::Base64 qw(encode_base64); $ENV{HTTPS_DEBUG} = 1; $ENV{HTTPS_VERSION} = '3'; $ENV{HTTPS_CERT_FILE} = 'C:/path/to/certificate.pem'; my $input_filename = "test.pdf"; my $input_filepath = "C:/path/$input_filename"; my $namespace = "http://host/path"; my $method_name = "MethodName"; my $soap_action = "http://host/path/soap_action"; my $end_point = "https://host/path/endpoint"; my $encoded_file = ''; my $buffer = ''; my $file_content = ''; if (open(my $ifh, $input_filepath)) { binmode($ifh); $file_content = do { local $/; <$ifh> }; close($ifh); } else { die "[Error] Could not open file - $input_filepath - $!"; } $encoded_file = encode_base64($file_content); my $file_size = -s $input_filepath; my $soap = SOAP::Lite -> uri($soap_action) -> on_action( sub { join '/', $namespace, $_ +[1] } ) -> proxy($end_point); my $method = SOAP::Data->name($method_name) ->attr( { xmlns => $namespace }); my @params = ( SOAP::Data->name("request" => \SO +AP::Data->value( SOAP::Data->name("FileName" => $in +put_filename)->type("string"), SOAP::Data->name("Filesize" => $fi +le_size)->type("int"), SOAP::Data->name("Data" => $en +coded_file)->type("base64Binary") )), ); print $soap->call($method => @params)->result;


In reply to Re: Any perl module support MTOM in SOAP::Lite? by tokpela
in thread Any perl module support MTOM in SOAP::Lite? by dcherng

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.