package CatalystX::Action::SOAP;
use Moose;
use namespace::autoclean;
extends 'Catalyst::Action';

sub execute {
    my $self = shift;
    my ( $controller, $c, @args ) = @_;


    $controller->soap_fault( $c, 405, 'Request must be a post' )
        unless $c->req->method eq 'POST';


    my $content_type = $c->req->content_type || 'missing';
    $controller->soap_fault( $c, 415, "Request content-type must be XML.  Found '$content_type'" )
        unless $content_type =~ /xml/;



    # Call base method, just in case want to do something with it.
    my $r = $self->next::method( @_ );


    $controller->process_soap_request( $c );

    return $r;
}


1;
