#!/usr/bin/perl
use strict; use warnings;

use LWP::UserAgent;
use XML::Simple;

my $request_xml = <<"EO_XML";
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xmlns:xsd="http://www.w3.org/2001/XMLSchema"
               xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body> 
      <clearDatabase
        xmlns="http://localhost/DefaultNamespace">
      </clearDatabase>
  </soap:Body>
</soap:Envelope>
EO_XML


my $ua = LWP::UserAgent->new();
$ua->agent( 'SunflowerMyBroadBand/1.0' );

my $request = HTTP::Request->new(
    POST => 'http://localhost/soap'
);

$request->content_type( 'text/xml; charset=utf-8' );
$request->header( 'Host' => 'localhost' );
$request->header(
        'SoapAction' => 'http://localhost/soap'
);
$request->content( $request_xml );

my $response = $ua->request( $request );

use Data::Dumper; warn Dumper( $response );

#my $parsed_response = XMLin( $response->content );

#use Data::Dumper; warn Dumper( $parsed_response );
