- Timestamp:
- 04/21/08 18:54:08 (7 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/perl/WebService-Simple/trunk/lib/WebService/Simple/Response.pm
r8953 r10071 1 # $Id$ 2 1 3 package WebService::Simple::Response; 4 use strict; 5 use warnings; 6 use base qw(HTTP::Response); 2 7 3 use warnings; 4 use strict; 5 use Carp; 6 use XML::Simple; 7 our $VERSION = '0.01'; 8 sub new_from_response 9 { 10 # XXX hack. This probably should be changed... 11 my $class = shift; 12 my %args = @_; 13 my $self = bless $args{response}, $class; 14 $self->{__parser} = $args{parser}; 15 return $self; 16 } 8 17 9 sub HTTP::Response::parse_xml { 10 my ($self, $opt) = @_; 11 my $xs = XML::Simple->new( %$opt ); 12 my $results; 13 eval { $results = $xs->XMLin($self->content) }; 14 croak("can't parse xml") if ($@); 15 return $results; 18 sub parse_response 19 { 20 my $self = shift; 21 return $self->{__parser}->parse_response($self); 16 22 } 17 23
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)