#!/usr/bin/perl -w use strict; use warnings; 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($key), SOAP::Data->name('value')->value($data_to_send_in_soap_map{$key}) ]); } @params = ( SOAP::Data->name('params')->type('ns2:Map')->value(\@soap_map) ); print Dumper (\@params);