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

Re^6: Problems with SOAP::Lite client

by thion (Initiate)
on Dec 16, 2008 at 09:27 UTC ( #730602=note: print w/ replies, xml ) Need Help??


in reply to Re^5: Problems with SOAP::Lite client
in thread Problems with SOAP::Lite client

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


Comment on Re^6: Problems with SOAP::Lite client
Select or Download Code
Re^7: Problems with SOAP::Lite client
by Anonymous Monk on Dec 16, 2008 at 14:36 UTC
    Do it again, this time just cut/paste and add comments. Do not make any other modifications.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://730602]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2014-09-18 07:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

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











    Results (109 votes), past polls