#!/usr/bin/perl -w use strict; use warnings; use diagnostics; use Data::Dumper; use SOAP::Lite; my %data_to_send_in_soap_map = ( 'country' => 'NL', 'step' => '1', ); my (@soap_map,@params); foreach my $key (keys %data_to_send_in_soap_map) { push @soap_map, \SOAP::Data -> name ('item') -> value ([ SOAP::Data -> name ($key) -> value ($data_to_send_in_soap_map{$key}), ]) ; } @params = ( SOAP::Data -> name ('params') -> value (@soap_map) ); print Dumper (\@params);