1 package Catalyst::Action::Deserialize::XML::Simple;
4 use namespace::autoclean;
6 extends 'Catalyst::Action';
10 my ( $controller, $c, $test ) = @_;
16 $c->log->debug("Could not load XML::Simple, refusing to deserialize: $@")
21 my $body = $c->request->body;
23 my $xs = XML::Simple->new('ForceArray' => 0,);
26 $rdata = $xs->XMLin( "$body" );
31 if (exists($rdata->{'data'})) {
32 $c->request->data($rdata->{'data'});
34 $c->request->data($rdata);
38 'I would have deserialized, but there was nothing in the body!')