Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
Hi,

thanks for all the help. I definitely will do a refresher of perlsub/perldata.
I built your suggestions into my code.
File data_sync_tool.pm:
while($sth->fetch()) { # zusatz scheint NULL zu sein... if(!defined($zusatz)) { $zusatz = ""; } print("$id => $plz => $stadt => $kurzname => $zusatz => $statu +s => $typ\n"); # Hash zusammenbasteln my %hash; $hash{"kurzname"} = $kurzname; $hash{"plz"} = $plz; $hash{"stadt"} = $stadt; $hash{"status"} = $status; $hash{"typ"} = $typ; $hash{"zusatz"} = $zusatz; push(@ary,\%hash); } $sth->finish(); # evtl. Fehlerbehandlung my $laenge = @ary; if($laenge > 0) { eval { print("DataSyncTool: @ary\n"); $dss->updatePLZInformationen(\@ary); # $dss = instance +of data_service.pm }; if($@) { # Fehler ausgeben chop($@); if($debug == 1) { &debug_out("updatePLZInformationen => FE +HLER:\n$@\n") }; $err_txt .= "updatePLZInformationen => FEHLER:\n$@\n"; } }
File data_service.pm:
sub updatePLZInformationen() { # überträgt geänderte PLZ-Daten my $data = shift; print("Yeehah: $data\n"); my $plz = SOAP::Lite -> service('file:/home/orca/oracle/DataSyncTool/config/SKADataServ +ice.wsdl'); $plz->updatePLZInformationen( SOAP::Data->type("xsd:string")->name("clientid" => "ska")->val +ue, SOAP::Data->type("xsd:string")->name("securitytoken" => "ska") +->value, SOAP::Data->type("tns2:PLZInfo")->name("plzinfos")->value( \SOAP::Data->value( &format_plz_infos($data) ) ) ); } # -------------------------------------------------------------------- +---------------------------- # sub format_plz_infos() { # formatiert den komplexen Typ "plzinfo" my $plz = shift; my @plz_info; print("Yeehah: $plz\n"); 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); } # -------------------------------------------------------------------- +---------------------------- #
And here's the output:
test@testmachine:~/test/DataSyncTool> ./data_sync_tool.pl 16:12:2008 09:14:13, DEBUG: Programm gestartet... 16:12:2008 09:14:13, DEBUG: updatePLZInformationen => Data of plz tabl +e: 1 => 01001 => Dresden => Dresden => => 1 => 3 2 => 01002 => Dresden => Dresden => => 1 => 3 3 => 01003 => Dresden => Dresden => => 1 => 3 4 => 01004 => Dresden => Dresden => => 1 => 3 DataSyncTool: HASH(0x86d81f8) HASH(0x8740d38) HASH(0x88058c0) HASH(0x8 +805920) Yeehah: DatenService=HASH(0x8743344) Yeehah: DatenService=HASH(0x8743344) 16:12:2008 09:14:13, DEBUG: updatePLZInformationen => FEHLER: Not an ARRAY reference at data_service.pm line 161. 16:12:2008 09:14:13, DEBUG: updatePLZInformationen => Fertig.
The error message is in the subroutine format_plz_infos():
foreach(@$plz) { ... }
I'm no perl specialist, unfortunately, and I surely have a lack of basics, but I really need some advice to get this client working... :-/

Thanks in advance,

Thion

In reply to Re^6: Problems with SOAP::Lite client by thion
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 having an uproarious good time at the Monastery: (11)
    As of 2014-09-19 06:32 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      How do you remember the number of days in each month?











      Results (132 votes), past polls