X-Git-Url: http://git.freeside.biz/gitweb/?p=Net-GlobalPOPs-MediaServicesAPI.git;a=blobdiff_plain;f=lib%2FNet%2FGlobalPOPs%2FMediaServicesAPI.pm;h=6b671fd3b2abe88ae19023e6bf0391fd2d5c95cc;hp=0f0a9402b755ca20c0476c5fb80850d68313de0c;hb=090a3e47b2880ff5b15027d2bcd29b0a448e2a9b;hpb=1ed8df25cb58e83f7470c714062a946b8d19ae07 diff --git a/lib/Net/GlobalPOPs/MediaServicesAPI.pm b/lib/Net/GlobalPOPs/MediaServicesAPI.pm index 0f0a940..6b671fd 100644 --- a/lib/Net/GlobalPOPs/MediaServicesAPI.pm +++ b/lib/Net/GlobalPOPs/MediaServicesAPI.pm @@ -109,7 +109,7 @@ sub AUTOLOAD { $w->xmlDecl('ISO-8859-1'); $w->doctype('request', undef, $URL); - $w->startTag('request', 'id' => '1'); #XXX request ID??? + $w->startTag('request', 'id' => ''); #XXX request ID??? $w->startTag('header'); $w->startTag('sender'); @@ -144,7 +144,7 @@ sub AUTOLOAD { $w->endTag('request'); - $output =~ s/\n\n/\n/g; + #$output =~ s/\n+/\n/g; warn "XML Request for $function function:\n$output" if $self->{'debug'}; @@ -152,9 +152,12 @@ sub AUTOLOAD { my( $page, $response, %reply_headers ) = https_post( 'host' => $HOST, 'path' => $PATH, - 'content' => $output, - 'Content-Type' => 'text/plain', - 'headers' => {}, + 'args' => { 'apidata' => $output, }, + #'content' => $output, + #'Content-Type' => 'text/plain', + #'Content-Type' => 'text/xml', + #'Content-Type' => 'application/xml', + #'headers' => {}, 'debug' => $self->{'debug'}, ); @@ -166,12 +169,17 @@ sub AUTOLOAD { warn "XML Response for $function function:\n: $page" if $self->{'debug'}; - my $hashref = XMLin $page; + my $hashref = XMLin( $page ); - warn "Parsed response for $function funtion:\n: ". Dumper($hashref) - if $self->{'debug'} + warn "Parsed response for $function funtion:\n". Dumper($hashref) + if $self->{'debug'}; + + my $return = $hashref->{'body'}; + + warn "Returning data:\n". Dumper($return) + if $self->{'debug'}; - %$hashref; + $return; }