Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

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=" +oding/" xmlns:soap="" xmlns: +soapenc="" xmlns:xsd="http:/ +/" xmlns:xsi=" +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

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!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • 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
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            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?

    What's my password?
    Create A New User
    [choroba]: are they?
    [LanX]: strict rules : the a is long in "straße" and short in "strasse"
    [choroba]: So the "a" is different, not the "s" ;-)
    [LanX]: people knowing that it's a workaround will pronounce it right
    [LanX]: well
    [LanX]: Maße and Masse are two very different words.
    LanX (measures/mass)
    [Tanktalus]: choroba: thanks, not sure why it wasn't doing that for me, but will try to figure it out. :)
    [LanX]: can I copy a authotification cookie from mozilla and reuse it in LWP::Useragent?
    [LanX]: nevermind

    How do I use this? | Other CB clients
    Other Users?
    Others having an uproarious good time at the Monastery: (11)
    As of 2018-03-21 15:51 GMT
    Find Nodes?
      Voting Booth?
      When I think of a mole I think of:

      Results (268 votes). Check out past polls.