SebastianH has asked for the wisdom of the Perl Monks concerning the following question:
Hello, i have a problem with a SOAP-Response an i hope someone can help me. I think something went wrong, when the SOAP-Response is deserialized by the SOAP::Lite Module. In the SOAP-Response are some "normal" Nodes and referenced Nodes. But non of it where correct deserialized.
Response:
<?xml version="1.0" encoding="UTF-8" ?> <SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/ +soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envel +ope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmln +s:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org +/2001/XMLSchema-instance"> <SOAP-ENV:Body> <ns1:SOAP_GetFirmenlisteResponse xmlns:ns1="http://www.4d.com/namespac +e/default"> <ERRORNUM xsi:type="xsd:int">0</ERRORNUM> <ERRORTEXT xsi:type="xsd:string"> </ERRORTEXT> <LISTE_KDLF_NR_ALS_IDS href="#ref-1"/> <LISTE_SUCHNAMEN href="# +ref-2"/> <LISTE_LFD_NR href="#ref-3"/> <LISTE_TIMESTAMP_GEAENDE +RT href="#ref-4"/> <LISTE_TIMESTAMP_ERZEUGT href="#ref-5"/> </ns1:SOAP_GetFirmenlisteResponse> <SOAP-ENC:Array id="ref-1" SOAP-ENC:arrayType="xsd:string[4]"> <item1>19288</item1> <item2>19289</item2> <item3>60107</item3> <item4>71897</item4> </SOAP-ENC:Array> <SOAP-ENC:Array id="ref-2" SOAP-ENC:arrayType="xsd:string[4]"> <item1>Blabla1</item1> <item2>Blabla2</item2> <item3>Bla München</item3> <item4>Blaürm BÄR</item4> </SOAP-ENC:Array> <SOAP-ENC:Array id="ref-3" SOAP-ENC:arrayType="xsd:int[4]"> <item1>-8423</item1> <item2>-8426</item2> <item3>-8425</item3> <item4>-8428</item4> </SOAP-ENC:Array> <SOAP-ENC:Array id="ref-4" SOAP-ENC:arrayType="xsd:string[4]"> <item1>2015-11-23T09:32:23</item1> <item2>2015-11-26T14:55:52</item2> <item3>2015-11-26T08:07:26</item3> <item4>2015-11-27T09:26:25</item4> </SOAP-ENC:Array> <SOAP-ENC:Array id="ref-5" SOAP-ENC:arrayType="xsd:string[4]"> <item1>2015-11-23T09:30:54</item1> <item2>2015-11-26T14:52:06</item2> <item3>2015-11-25T10:33:27</item3> <item4>2015-11-27T09:24:05</item4> </SOAP-ENC:Array> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
Dump Result:
$VAR1 = { 'ARRAY(0x2c16e08)' => undef, '0' => '', 'ARRAY(0x2f42168)' => [ 'Blabla1', 'Blabla2', "Bla M\x{fc}nchen", "Bla\x{fc}rm B\x{c4}R" ], 'ARRAY(0x2f39680)' => [ '2015-11-23T09:32:23', '2015-11-26T14:55:52', '2015-11-26T08:07:26', '2015-11-27T09:26:25' ] };
Perl Code:
#!/usr/bin/perl use Data::Dumper; use SOAP::Lite +trace => [ transport => \&log_message ]; sub log_message { my ($in) = @_; my ($cont) = $in->content; $cont =~ s/></>\n</g; print "\n-------------------------------------------------\n"; print $cont; print "\n-------------------------------------------------\n"; } my $soap = SOAP::Lite->service('http://192.168.0.13:8181/4dwsdl'); $soap->envprefix('SOAP-ENV'); $soap->encprefix('SOAP-ENC'); $soap->soapversion('1.1'); my %result = $soap->SOAP_GetFirmenliste( '00', 'SOAPTest', 'soaptest', '0000-00-00', '2015-10-01' ); print Dumper(\%result); exit 0;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Problem with SOAP::Lite (WSDL) Response (Deserializer / References)
by beech (Parson) on Dec 04, 2015 at 10:18 UTC | |
by SebastianH (Initiate) on Dec 07, 2015 at 09:05 UTC | |
by Anonymous Monk on Dec 07, 2015 at 12:28 UTC |