- $w->startTag('body');
-
- $w->dataElement( 'requesttype' => $function );
-
- if ( keys %$opts ) {
- $w->startTag('item');
- foreach my $opt ( keys %$opts ) {
- $w->dataElement( $opt => $opts->{$opt} );
- }
- $w->endTag('item');
- }
-
- $w->endTag('body');
-
- $w->endTag('request');
-
- #$output =~ s/\n+/\n/g;
-
- warn "XML Request for $function function:\n$output"
- if $self->{'debug'} > 1;
-
- my( $page, $response, %reply_headers ) = https_post(
- 'host' => $HOST,
- 'port' => $PORT,
- 'path' => ($PATH||443),
- 'args' => { 'apidata' => $output, },
- #'content' => $output,
- #'Content-Type' => 'text/plain',
- #'Content-Type' => 'text/xml',
- 'Content-Type' => 'application/xml',
- #'headers' => {},
- 'debug' => ( $self->{'debug'} > 1 ? 1 : 0 ),
- );
-
- unless ( $response =~ /^200/i ) {
- $self->{'errstr'} = $response;
- return '';
- }
-
- warn "XML Response for $function function:\n: $page"
- if $self->{'debug'} > 1;
-
- my $hashref = XMLin( $page );
-
- warn "Parsed response for $function funtion:\n". Dumper($hashref)
- if $self->{'debug'} > 1;
-
- my $return = $hashref->{'body'};
-
- warn "Returning data:\n". Dumper($return)
- if $self->{'debug'} > 1;
-
- $return;