jgooch has asked for the wisdom of the Perl Monks concerning the following question:
When I check the log, $queue_name is blank. When I view the Data::Dumper output I see:-# parse the message (executed within eval so parsing errors are no +n-fatal) eval { $parsed_xml = XMLin( $message, forcearray => 1, keyattr => [] ); }; # if parsing errors were encountered, write the appropriate messag +e to the log if ($@) { &stop_it($ERROR, $XMLERROR, "Parsing error encountered - $@", +$log_file); } $queue_name = $parsed_xml->{descriptor}->{inputQueue}; &log_it($INFO, "inputQueue is $queue_name", $log_file); print Dumper($parsed_xml);
So, it looks to me like the field descriptor/inputQueue is present but not being picked up by the code. I've had code like this working in the past but for the life of me I can't spot what I'm doing wrong. Can you? Thanks, J.'descriptor' => [ { 'uniqueId' => [ 'X\'414d51204d534f4c5530 +3220202020203ed6d4ec00023332\'' ], 'resubCounter' => [ '0' ], 'failureTimestamp' => [ '2004-01-13 15:0 +0:00.000' ], 'errorCode' => [ '1234' ], 'messageType' => [ 'TEST.MESSAGE' ], 'inputQueue' => [ 'BLACKHOLE' ], 'destinationSystem' => [ 'NOWHERE' ], 'dataFormat' => [ 'XML' ], 'portfolioCode' => [ 'NONE' ], 'errorDescription' => [ 'Blackhole messa +ge' ], 'sourceSystem' => [ 'TEST' ] } ], 'body' => [ { 'contents' => [ 'Some data' ] } ]
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: XML parsing problem.
by Art_XIV (Hermit) on Jan 13, 2004 at 18:06 UTC | |
|
Re: XML parsing problem.
by gmpassos (Priest) on Jan 14, 2004 at 01:37 UTC | |
by jgooch (Initiate) on Jan 14, 2004 at 08:55 UTC | |
|
Re: XML parsing problem.
by derby (Abbot) on Jan 13, 2004 at 18:02 UTC |