I am sending requests to a web service using SOAP::Lite, but the service is returning an error code. I think I have set up my request correctly, but have yet to figure out how to print out the XML I am sending to verify that it is being sent as specified by the operator of the service. I can view the response XML by setting outputxml to true as follows:
my $uri = "http://service/uri" ; my $proxy = "https://service.provider.address/Service/service.asmx?WSD +L" ; my $service = SOAP::Lite ->uri($uri) ->proxy($proxy) ->autotype(0) ->outputxml(1) ->on_action( sub { join '/', @_ } ) ; my $response = $service->MethodName( SOAP::Header ->name( 'AuthHeader' ) ->value( { header1 => $header_1, header2 => $header_2 } ), SOAP::Data ->name( 'NamedParam1' ) ->type( 'string' ) ->value( $named_param_1 ), SOAP::Data ->name( 'NamedParam2' ) ->type( 'string' ) ->value( $named_param_2 ) ) ; print "RESPONSE: $response\n" ;
Is there some way I can see the request in a similar fashion?

In reply to Displaying SOAP::Lite request XML by Rice

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.