Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

comment on

( [id://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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (2)
As of 2024-04-20 03:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found