Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

comment on

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

thanks for the example.

I tried to build it into my "real" code, but I'm messing up something. I'm reading data from a database here and generate an array of hashes:
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);
And here is the function that's called and is doing the actual SOAP stuff:
sub updatePLZInformationen() { my @data = shift; my $plz = SOAP::Lite -> service('file:/home/orca/oracle/DataSyncTool/config/SKADataServ +ice.wsdl'); my $serializer = $plz->serializer(); print($serializer->envelope( method => 'updatePLZInformationen', SOAP::Data->type("xsd:string")->name( "c +lientid" => "test" ), SOAP::Data->type("xsd:string")->name( "s +ecuritytoken" => "test" ), SOAP::Data->type("tns2:PLZInfo")->name(" +plzinfos")->value( \SOAP::Data->value(&format_plz_infos(@ +data))))); $plz->updatePLZInformationen(); } # -------------------------------------------------------------------- +---------------------------- # 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); } # -------------------------------------------------------------------- +---------------------------- #
And this is my SOAP-message:
?xml version="1.0" encoding="UTF-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body><updatePLZInformationen> <clientid xsi:type="xsd:string">test</clientid> <securitytoken xsi:type="xsd:string">test</securitytoken> <plzinfos xsi:type="tns2:PLZInfo"> <kurzname xsi:nil="true" xsi:type="xsd:string" /> <plz xsi:nil="true" xsi:type="xsd:string" /> <stadt xsi:nil="true" xsi:type="xsd:string" /> <status xsi:nil="true" xsi:type="xsd:string" /> <typ xsi:nil="true" xsi:type="xsd:string" /> <zusatz xsi:nil="true" xsi:type="xsd:string" /> </plzinfos> </updatePLZInformationen> </soap:Body> </soap:Envelope>
The message looks good, but it has no values... I'm reading my code for about an hour now, but I don't seem to get the mistake. :-(

Thanks in advance,

Thion

In reply to Re^2: 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 surveying the Monastery: (4)
As of 2024-04-24 12:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found