3 |
use strict; |
use strict; |
4 |
use warnings; |
use warnings; |
5 |
|
|
|
use XML::Generator; |
|
6 |
use base qw/Class::Accessor/; |
use base qw/Class::Accessor/; |
7 |
__PACKAGE__->add_accessor( qw/ |
__PACKAGE__->add_accessor( qw/ |
8 |
debug |
debug |
9 |
/); |
/); |
10 |
|
|
11 |
|
use XML::Generator; |
12 |
|
use Carp qw/confess/; |
13 |
|
use Data::Dump qw/dump/; |
14 |
|
|
15 |
=head1 NAME |
=head1 NAME |
16 |
|
|
17 |
CWMP::Response - generate SOAP meesage for response |
CWMP::Response - generate SOAP meesage for response |
39 |
|
|
40 |
=head2 Inform |
=head2 Inform |
41 |
|
|
42 |
$response->Inform; |
$response->Inform( $state ); |
43 |
|
|
44 |
=cut |
=cut |
45 |
|
|
46 |
sub Inform { |
sub Inform { |
47 |
my $self = shift; |
my $self = shift; |
48 |
|
|
49 |
|
my $state = shift or confess "no state?"; |
50 |
|
|
51 |
|
confess "no ID in state ", dump( $state ) unless ( $state->{ID} ); |
52 |
|
|
53 |
my $X = XML::Generator->new(':pretty'); |
my $X = XML::Generator->new(':pretty'); |
54 |
|
|
55 |
return $X->Envelope( $soap, { 'soap:encodingStyle' => "http://schemas.xmlsoap.org/soap/encoding/" }, |
return $X->Envelope( $soap, { 'soap:encodingStyle' => "http://schemas.xmlsoap.org/soap/encoding/" }, |
56 |
$X->Header( $soap, |
$X->Header( $soap, |
57 |
$X->ID( $cwmp, { mustUnderstand => 1 }, 1234 ), |
$X->ID( $cwmp, { mustUnderstand => 1 }, $state->{ID} ), |
58 |
), |
), |
59 |
$X->Body( $soap, |
$X->Body( $soap, |
60 |
$X->InformResponse( $cwmp, |
$X->InformResponse( $cwmp, |