2 # Catlyst::Action::Deserialize::XML::Simple.pm
3 # Created by: Adam Jacob, Marchex, <adam@marchex.com>
4 # Created on: 10/12/2006 03:00:32 PM PDT
8 package Catalyst::Action::Deserialize::XML::Simple;
13 use base 'Catalyst::Action';
17 my ( $controller, $c, $test ) = @_;
23 $c->log->debug("Could not load XML::Simple, refusing to deserialize: $@");
27 my $body = $c->request->body;
29 my $xs = XML::Simple->new('ForceArray' => 0,);
32 $rdata = $xs->XMLin( "$body" );
37 if (exists($rdata->{'data'})) {
38 $c->request->data($rdata->{'data'});
40 $c->request->data($rdata);
44 'I would have deserialized, but there was nothing in the body!');