Sorry, my first go was more complicated than necessary.
Here is a second simplified go to demonstrate my problem:
#!/usr/bin/perl
use warnings;
use strict;
use SOAP::Lite;
my $xml = <<'eof';
<?xml version="1.0"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/env
+elope/">
<SOAP-ENV:Header/>
<SOAP-ENV:Body>
<command id="1">
<message id="2">
<time time="27.07.2007-10:37:49 +0200"/>
</message>
</command>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
eof
my $som = SOAP::Deserializer->deserialize($xml);
print "time = ", $som->dataof('//command/message/time')->attr->{time},
+ "\n";
print "done.\n";
Output is
time = 27.07.2007-10:37:49 +0200
done.
but
Can't call method "attr" on an undefined value at deserialize-test2.pl
+ line 23.
as soon as the id attributes of command and message are identical.
I wouldn't care if I could get the raw XML from the SOAP response.
Axel.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
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, details, 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, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.