confess "no state?" unless ($state);
confess "no body closure" unless ( $closure );
- confess "no ID in state ", dump( $state ) unless ( $state->{ID} );
-
#warn "state used to generate xml = ", dump( $state ) if $self->debug;
my $X = XML::Generator->new(':pretty');
+ my @header;
+ push( @header, $X->ID( $cwmp, { mustUnderstand => 1 }, $state->{ID} )) if $state->{ID};
+ push( @header, $X->NoMoreRequests( $cwmp, $state->{NoMoreRequests} || 0 ));
+
return $X->Envelope( $soap, { 'soap:encodingStyle' => "http://schemas.xmlsoap.org/soap/encoding/" },
- $X->Header( $soap,
- $X->ID( $cwmp, { mustUnderstand => 1 }, $state->{ID} ),
- $X->NoMoreRequests( $cwmp, $state->{NoMoreRequests} || 0 ),
- ),
+ $X->Header( $soap, @header ),
$X->Body( $soap, $closure->( $X, $state ) ),
);
}
my ( $self, $state ) = @_;
$self->xml( $state, sub {
my ( $X, $state ) = @_;
- $X->GetRPCMethods();
+ $X->GetRPCMethods( $cwmp, '' );
});
};
my ( $X, $state ) = @_;
$X->SetParameterValues( $cwmp,
- $X->ParameterList( $cwmp,
- $X->ParameterNames( $cwmp,
- map {
- $X->ParameterValueStruct( $cwmp,
- $X->Name( $cwmp, $_ ),
- $X->Value( $cwmp, $params->{$_} )
- )
- } sort keys %$params
- )
- )
+ $X->ParameterList( [],
+ map {
+ $X->ParameterValueStruct( [],
+ $X->Name( [], $_ ),
+ $X->Value( [], $params->{$_} )
+ )
+ } sort keys %$params
+ ),
+ $X->ParameterKey( '' ),
);
});
}
my $self = shift;
my $state = shift;
my @ParameterNames = _array_param(shift);
- confess "GetParameterValues need ParameterNames" unless @ParameterNames;
warn "# GetParameterValues", dump( @ParameterNames ), "\n" if $self->debug;
$self->xml( $state, sub {
});
}
+=head2 GetParameterAttributes
+
+ $method->GetParameterAttributes( $state, [ $ParametarNames, ... ] );
+
+=cut
+
+sub GetParameterAttributes {
+ my ( $self, $state, $param ) = @_;
+ my @ParameterNames = _array_param($param);
+
+ warn "# GetParameterAttributes", dump( @ParameterNames ), "\n" if $self->debug;
+
+ $self->xml( $state, sub {
+ my ( $X, $state ) = @_;
+
+ $X->GetParameterAttributes( $cwmp,
+ $X->ParameterNames( $cwmp,
+ map {
+ $X->string( $xsd, $_ )
+ } @ParameterNames
+ )
+ );
+ });
+}
+
=head2 Reboot
$method->Reboot( $state );
});
}
+=head2 FactoryReset
+
+ $method->FactoryReset( $state );
+
+=cut
+
+sub FactoryReset {
+ my ( $self, $state ) = @_;
+ $self->xml( $state, sub {
+ my ( $X, $state ) = @_;
+ $X->FactoryReset();
+ });
+}
+
=head1 Server methods