Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl use strict; use warnings; use XML::Simple; use Data::Dumper; use Data::Dump 'pp'; #my $content = $response->decoded_content(); my $content = qq|<?xml version=\'1.0\' encoding=\'UTF-8\'?><soap:Envel +ope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Header><ais:requestID xmlns:ais="http://com"> {7f000001-47db2420000001569783cdb88136} </ais:requestID> </soap:Header> <soap:Body> <soap:Fault> <faultcode>soap:Server</faultcode> <faultstring> check expression: </faultstring> <faultactor>CheckTwo</faultactor> <detail> <longDescription xmlns="http://com"> Exception occurred </longDescription> <MaxCode xmlns="http://com/Server">-2225</MaxCode> </detail> </soap:Fault> </soap:Body> </soap:Envelope>|; #my $parser = new XML::Simple; my $parser= XML::Simple->new( KeepRoot => 1, KeyAttr => [], ForceArray + => [qw( MaxCode )] ); my $result = $data->{'soap:Body'}->{'soap:Fault'}->{'detail'}->{'Error +Code'}; print $result; # I neet to print this::: -2225
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Parsing with XML::Simple
by jellisii2 (Hermit) on Aug 23, 2016 at 20:33 UTC | |
|
Re: Parsing with XML::Simple
by Mr. Muskrat (Canon) on Aug 23, 2016 at 18:56 UTC | |
by Anonymous Monk on Aug 23, 2016 at 19:05 UTC | |
by Mr. Muskrat (Canon) on Aug 23, 2016 at 19:33 UTC | |
by Anonymous Monk on Aug 23, 2016 at 19:55 UTC | |
|
Re: Parsing with XML::Simple
by Anonymous Monk on Aug 23, 2016 at 21:52 UTC | |
|
Re: Parsing with XML::Simple
by Jenda (Abbot) on Aug 25, 2016 at 13:17 UTC |