44 |
=cut |
=cut |
45 |
|
|
46 |
sub Inform { |
sub Inform { |
47 |
|
my ( $self, $state ) = @_; |
48 |
|
$self->xml( $state, sub { |
49 |
|
my ( $X, $state ) = @_; |
50 |
|
$X->InformResponse( $cwmp, |
51 |
|
$X->MaxEnvelopes( $cwmp, 1 ) |
52 |
|
); |
53 |
|
}); |
54 |
|
} |
55 |
|
|
56 |
|
=head2 GetRPCMethods |
57 |
|
|
58 |
|
$response->GetRPCMethods( $state ); |
59 |
|
|
60 |
|
=cut |
61 |
|
|
62 |
|
sub GetRPCMethods { |
63 |
|
my ( $self, $state ) = @_; |
64 |
|
$self->xml( $state, sub { |
65 |
|
my ( $X, $state ) = @_; |
66 |
|
$X->GetRPCMethods(); |
67 |
|
}); |
68 |
|
}; |
69 |
|
|
70 |
|
=head2 xml |
71 |
|
|
72 |
|
Used to implement methods which modify just body of soap message. |
73 |
|
For examples, see source of this module. |
74 |
|
|
75 |
|
=cut |
76 |
|
|
77 |
|
sub xml { |
78 |
my $self = shift; |
my $self = shift; |
79 |
|
|
80 |
my $state = shift or confess "no state?"; |
my ( $state, $closure ) = @_; |
81 |
|
|
82 |
|
confess "no state?" unless ($state); |
83 |
|
confess "no body closure" unless ( $closure ); |
84 |
|
|
85 |
confess "no ID in state ", dump( $state ) unless ( $state->{ID} ); |
confess "no ID in state ", dump( $state ) unless ( $state->{ID} ); |
86 |
|
|
90 |
$X->Header( $soap, |
$X->Header( $soap, |
91 |
$X->ID( $cwmp, { mustUnderstand => 1 }, $state->{ID} ), |
$X->ID( $cwmp, { mustUnderstand => 1 }, $state->{ID} ), |
92 |
), |
), |
93 |
$X->Body( $soap, |
$X->Body( $soap, $closure->( $X, $state ) ), |
|
$X->InformResponse( $cwmp, |
|
|
$X->MaxEnvelopes( $cwmp, 1 ) |
|
|
) |
|
|
), |
|
94 |
); |
); |
95 |
} |
} |
96 |
|
|