I have a SOAP server that dispatches to a module fine. Once it gets to the sendMsg2Vbs subroutine the incoming data is a hash that I cannot output to a file which is what I need to do. The incoming data is coming from a client that I have no control over. It's also loaded with tags containing attributes like this <Entity name="city" sectionEntityMapId="190" value="EAST DOVER"/>. Ultimately, I want to create an xml file with the entire incoming xml message. How do I do this? Thank you for your help.

Here is my SOAP server:

#!/usr/bin/perl use strict; use SOAP::Transport::HTTP; use lib '/var/www/soap'; use vbsservice; my $server = SOAP::Transport::HTTP::CGI ->dispatch_to('sendMsg2Vbs') ->handle; 1;

Here is the vbsservice module:

#!/usr/local/bin/perl package vbsservice; use Switch; use warnings; use Exporter; our @ISA = (Exporter); our @EXPORT = qw(sendMsg2Vbs); sub sendMsg2Vbs { my($class,$data)=@_; ...

I'd like to output $data to a file but it is a hash. Any help would be very much appreciated. Thank you.


In reply to Caturing incoming XML from SOAP server by gackles

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.