Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
Well thats not detailed enough to be pseudocode, but OK, if you really want to stick with that strategy, here it is:
while($sth->fetch()) { my %hash; # Hash zusammenbasteln $hash{"kurzname"} = $kurzname; $hash{"plz"} = $plz; $hash{"stadt"} = $stadt; $hash{"status"} = $status; $hash{"typ"} = $typ; $hash{"zusatz"} = $zusatz; push(@ary,\%hash); } $sth->finish(); $dss->updatePLZInformationen(\@ary); sub updatePLZInformationen { my $dss = shift; my $data = shift; my $plz = SOAP::Lite -> service('file:/home/orca/oracle/DataSyncTool/config/SKADataServ +ice.wsdl'); $plz->updatePLZInformationen( SOAP::Data->type("xsd:string")->name( "clientid" => "test" +), SOAP::Data->type("xsd:string")->name( "securitytoken" => "test +" ), SOAP::Data->type("tns2:PLZInfo")->name("plzinfos")->value( \SOAP::Data->value( format_plz_infos($data) ) ) ); } # -------------------------------------------------------------------- +---------------------------- # sub format_plz_infos { my $plz = shift; my @plz_info; foreach(@$plz) { my $hash = $_; push(@plz_info,SOAP::Data->name("kurzname")->value($hash->{"ku +rzname"})->type("xsd:string")); push(@plz_info,SOAP::Data->name("plz")->value($hash->{"plz"})- +>type("xsd:string")); push(@plz_info,SOAP::Data->name("stadt")->value($hash->{"stadt +"})->type("xsd:string")); push(@plz_info,SOAP::Data->name("status")->value($hash->{"stat +us"})->type("xsd:string")); push(@plz_info,SOAP::Data->name("typ")->value($hash->{"typ"})- +>type("xsd:string")); push(@plz_info,SOAP::Data->name("zusatz")->value($hash->{"zusa +tz"})->type("xsd:string")); } return(@plz_info); }
for testing I used
# dummy data my @ary = map { my $t = $_; scalar { map {$_ => "$t$_"} qw! kurzname plz stadt status typ zusatz ! }; } 1 .. 3; use Data::Dumper;local $Data::Dumper::Indent=1;print Dumper(\@ary); updatePLZInformationen("dss",\@ary);
and the output was
$VAR1 = [ { 'kurzname' => '1kurzname', 'zusatz' => '1zusatz', 'status' => '1status', 'plz' => '1plz', 'stadt' => '1stadt', 'typ' => '1typ' }, { 'kurzname' => '2kurzname', 'zusatz' => '2zusatz', 'status' => '2status', 'plz' => '2plz', 'stadt' => '2stadt', 'typ' => '2typ' }, { 'kurzname' => '3kurzname', 'zusatz' => '3zusatz', 'status' => '3status', 'plz' => '3plz', 'stadt' => '3stadt', 'typ' => '3typ' } ]; <?xml version="1.0" encoding="UTF-8"?> <soap:Envelope soap:encodingStyle="http://schemas.xmlsoap.org/soap/enc +oding/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns: +soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http:/ +/www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSche +ma-instance"> <soap:Body> <updatePLZInformationen> <clientid xsi:type="xsd:string">test</clientid> <securitytoken xsi:type="xsd:string">test</securitytoken> <plzinfos xsi:type="tns2:PLZInfo"> <kurzname xsi:type="xsd:string">1kurzname</kurzname> <plz xsi:type="xsd:string">1plz</plz> <stadt xsi:type="xsd:string">1stadt</stadt> <status xsi:type="xsd:string">1status</status> <typ xsi:type="xsd:string">1typ</typ> <zusatz xsi:type="xsd:string">1zusatz</zusatz> <kurzname xsi:type="xsd:string">2kurzname</kurzname> <plz xsi:type="xsd:string">2plz</plz> <stadt xsi:type="xsd:string">2stadt</stadt> <status xsi:type="xsd:string">2status</status> <typ xsi:type="xsd:string">2typ</typ> <zusatz xsi:type="xsd:string">2zusatz</zusatz> <kurzname xsi:type="xsd:string">3kurzname</kurzname> <plz xsi:type="xsd:string">3plz</plz> <stadt xsi:type="xsd:string">3stadt</stadt> <status xsi:type="xsd:string">3status</status> <typ xsi:type="xsd:string">3typ</typ> <zusatz xsi:type="xsd:string">3zusatz</zusatz> </plzinfos> </updatePLZInformationen> </soap:Body> </soap:Envelope>
I suggest a refresher of perlsub/perldata.

In reply to Re^5: Problems with SOAP::Lite client by Anonymous Monk
in thread Problems with SOAP::Lite client by thion

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others drinking their drinks and smoking their pipes about the Monastery: (16)
    As of 2014-07-14 15:41 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      When choosing user names for websites, I prefer to use:








      Results (265 votes), past polls