default_queue => [
'GetRPCMethods',
[ 'GetParameterNames', 'InternetGatewayDevice.DeviceInfo.SerialNumber', 0 ],
- [ 'GetParameterValues', 'InternetGatewayDevice.DeviceInfo.SerialNumber', 1 ],
+ [ 'GetParameterNames', 'InternetGatewayDevice.DeviceInfo.', 1 ],
+ [ 'GetParameterValues',
+ 'InternetGatewayDevice.DeviceInfo.SerialNumber',
+ 'InternetGatewayDevice.DeviceInfo.VendorConfigFile.',
+ ],
# 'Reboot',
],
});
my $cwmp = [ cwmp => 'urn:dslforum-org:cwmp-1-0' ];
-my $soap = [ soap => "http://schemas.xmlsoap.org/soap/envelope/" ];
+my $soap = [ soap => 'http://schemas.xmlsoap.org/soap/envelope/' ];
+my $xsd = [ xsd => 'http://www.w3.org/2001/XMLSchema-instance' ];
=head2 InformResponse
=head2 GetParameterValues
- $response->GetParameterValues( $state, $ParameterPath, $NextLevel );
+ $response->GetParameterValues( $state, $ParameterNames );
=cut
sub GetParameterValues {
- my ( $self, $state, $ParameterPath, $NextLevel ) = @_;
- $ParameterPath ||= ''; # all
- $NextLevel ||= 0; # all
- warn "# GetParameterValues( '$ParameterPath', $NextLevel )\n" if $self->debug;
+ my $self = shift;
+ my $state = shift;
+ my @ParameterNames = @_;
+ confess "need ParameterNames" unless @ParameterNames;
+ warn "# GetParameterValues", dump( @ParameterNames ), "\n" if $self->debug;
+
$self->xml( $state, sub {
my ( $X, $state ) = @_;
$X->GetParameterValues( $cwmp,
- $X->ParameterPath( $cwmp, $ParameterPath ),
- $X->NextLevel( $cwmp, $NextLevel ),
+ $X->ParameterNames( $cwmp,
+ map {
+ $X->string( $xsd, $_ )
+ } @ParameterNames
+ )
);
});
}
confess "unknown store module $module not one of ", dump( $self->possible_stores ) unless $s;
- warn "#### current store = $s\n" if $self->debug > 4;
+# warn "#### current store = $s\n" if $self->debug > 4;
return $s;
}
warn "## $s ", dump( $stat ), $/ if $self->debug;
+ # FIXME if it ends with a dot (array values), remove it
+ $s =~ s/\.$//;
+
return $s;
}
ID => 42,
};
+ diag "check_response $command",dump( 'state', @_ ) if $debug;
ok( my $xml = $response->$command( $state, @_ ), "generate response $command" . dump(@_) );
my $file = "$abs_path/response/$command.xml";
check_response( 'InformResponse' );
check_response( 'GetRPCMethods' );
check_response( 'Reboot' );
-check_response( 'GetParameterNames', 'InternetGatewayDevice.DeviceInfo.SerialNumber', 0 );
-check_response( 'GetParameterValues' );
+check_response( 'GetParameterNames', 'InternetGatewayDevice.DeviceInfo.SerialNumber' );
+check_response( 'GetParameterValues', 'InternetGatewayDevice.DeviceInfo.SerialNumber', 'InternetGatewayDevice.DeviceInfo.VendorConfigFile.' );
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:cwmp="urn:dslforum-org:cwmp-1-0"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema-instance"
soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<soap:Header>
<cwmp:ID mustUnderstand="1">42</cwmp:ID>
</soap:Header>
<soap:Body>
<cwmp:GetParameterValues>
- <cwmp:ParameterPath></cwmp:ParameterPath>
- <cwmp:NextLevel>0</cwmp:NextLevel>
+ <cwmp:ParameterNames>
+ <xsd:string>InternetGatewayDevice.DeviceInfo.SerialNumber</xsd:string>
+ <xsd:string>InternetGatewayDevice.DeviceInfo.VendorConfigFile.</xsd:string>
+ </cwmp:ParameterNames>
</cwmp:GetParameterValues>
</soap:Body>
</soap:Envelope>
\ No newline at end of file