foreach my $key (keys %data_to_send_in_soap_map) { push @soap_map,[ SOAP::Data->name('key')->value($key), SOAP::Data->name('value')->value($data_to_send_in_soap_map{$key}) ]; } @params = ( SOAP::Data->name('params')->type('ns2:Map')->value(\@soap_map) );