WebService::Simple::Response - Adds a parse_response() to HTTP::Response


WebService-Simple documentation Contained in the WebService-Simple distribution.

Index


Code Index:

NAME

Top

WebService::Simple::Response - Adds a parse_response() to HTTP::Response

SYNOPSIS

Top

  # Internal use only

METHODS

Top

new_from_response

parse_response

Parses the response content using the specified parser

parse_xml

This is a n alias for parse_response() for backwards compatibility. Use parse_response instead.

AUTHOR

Top

Yusuke Wada <yusuke@kamawada.com>

Daisuke Maki <daisuke@endeworks.jp>

COPYRIGHT AND LICENSE

Top


WebService-Simple documentation Contained in the WebService-Simple distribution.

# $Id$

package WebService::Simple::Response;
use strict;
use warnings;
use base qw(HTTP::Response);

our $VERSION = "0.02";

sub new_from_response {

    # XXX hack. This probably should be changed...
    my $class = shift;
    my %args  = @_;
    my $self  = bless $args{response}, $class;
    $self->{__parser} = $args{parser};
    return $self;
}

sub parse_response {
    my $self = shift;
    return $self->{__parser}->parse_response( $self );
}

*parse_xml = \&parse_response;

1;

__END__