Thread Datenstruktur mit SOAP::Data
(4 answers)
Opened by bianca at 2010-06-13 17:32
Schau mal hier: msg #137607 Speziell:
Quote Und vergleiche das mit: Guest bianca Ich würde vermuten, dass es so richtig ist: Code (perl): (dl
)
\SOAP::Data -> name ($key) -> value ($data_to_send_in_soap_map{$key}), Code (perl): (dl
)
SOAP::Data -> name ('params') -> value(\@soap_map); vollständiger Code: Code (perl): (dl
)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 #!/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); EDIT: Code korrigiert Last edited: 2010-06-14 04:02:47 +0200 (CEST) |