SOAP
am 09.04.2008 15:29:10 von KevinO
Hi
I "inherited" a program which contains this line:
$a = $soap->call( $retrieveXmlList => @params )->result ;
I added:
print "$a\n" ;
Which produced:
HASH(0x50c5d4)
How do I proceed from here to see and parse the XML tree/data?
Thanks
KO
Re: SOAP
am 09.04.2008 15:40:20 von Mpapec
KevinO wrote:
> Hi
>
> I "inherited" a program which contains this line:
> $a = $soap->call( $retrieveXmlList => @params )->result ;
>
> I added:
> print "$a\n" ;
>
> Which produced:
> HASH(0x50c5d4)
>
> How do I proceed from here to see and parse the XML tree/data?
Most probably you don't need to parse anything, as $a already contain
final result from soap call.
use Data::Dumper;
print Dumper $a
Re: SOAP
am 09.04.2008 17:03:02 von KevinO
On Apr 9, 9:40 am, Matija Papec wrote:
> KevinO wrote:
> > Hi
>
> > I "inherited" a program which contains this line:
> > $a = $soap->call( $retrieveXmlList => @params )->result ;
>
> > I added:
> > print "$a\n" ;
>
> > Which produced:
> > HASH(0x50c5d4)
>
> > How do I proceed from here to see and parse the XML tree/data?
>
> Most probably you don't need to parse anything, as $a already contain
> final result from soap call.
>
> use Data::Dumper;
> print Dumper $a
Matija
Thanks for the quick response.
However, it seems that the Dumper returns only the last item in the
list.
It is very likely my ignorance in the subject.
So, if I may push it a bit...
1. How do I get everything from Dumper?
2. How would I use an XML parser here?
Many Thanks
KO
Re: SOAP
am 09.04.2008 17:07:35 von it_says_BALLS_on_your forehead
On Apr 9, 11:03=A0am, KevinO wrote:
> On Apr 9, 9:40 am, Matija Papec wrote:
>
>
>
> > KevinO wrote:
> > > Hi
>
> > > I "inherited" a program which contains this line:
> > > $a =3D $soap->call( $retrieveXmlList =3D> @params )->result ;
>
> > > I added:
> > > print "$a\n" ;
>
> > > Which produced:
> > > HASH(0x50c5d4)
>
> > > How do I proceed from here to see and parse the XML tree/data?
>
> > Most probably you don't need to parse anything, as $a already contain
> > final result from soap call.
>
> > use Data::Dumper;
> > print Dumper $a
>
> Matija
>
> Thanks for the quick response.
> However, it seems that the Dumper returns only the last item in the
> list.
Why do you jump to this conclusion rather than guess that the thing
that Dumper is trying to dump only has the last item?
Re: SOAP
am 09.04.2008 17:18:42 von KevinO
On Apr 9, 11:07 am, nolo contendere wrote:
> On Apr 9, 11:03 am, KevinO wrote:
>
>
>
> > On Apr 9, 9:40 am, Matija Papec wrote:
>
> > > KevinO wrote:
> > > > Hi
>
> > > > I "inherited" a program which contains this line:
> > > > $a = $soap->call( $retrieveXmlList => @params )->result ;
>
> > > > I added:
> > > > print "$a\n" ;
>
> > > > Which produced:
> > > > HASH(0x50c5d4)
>
> > > > How do I proceed from here to see and parse the XML tree/data?
>
> > > Most probably you don't need to parse anything, as $a already contain
> > > final result from soap call.
>
> > > use Data::Dumper;
> > > print Dumper $a
>
> > Matija
>
> > Thanks for the quick response.
> > However, it seems that the Dumper returns only the last item in the
> > list.
>
> Why do you jump to this conclusion rather than guess that the thing
> that Dumper is trying to dump only has the last item?
I don't know Perl well enough and Dumper in particular. That leaves
me with only one option - make assumptions and respectfully ask for
help.
KO
Re: SOAP
am 09.04.2008 17:27:29 von RedGrittyBrick
KevinO wrote:
> On Apr 9, 11:07 am, nolo contendere wrote:
>> On Apr 9, 11:03 am, KevinO wrote:
>>
>>
>>
>>> On Apr 9, 9:40 am, Matija Papec wrote:
>>>> KevinO wrote:
>>>>> Hi
>>>>> I "inherited" a program which contains this line:
>>>>> $a = $soap->call( $retrieveXmlList => @params )->result ;
>>>>> I added:
>>>>> print "$a\n" ;
>>>>> Which produced:
>>>>> HASH(0x50c5d4)
>>>>> How do I proceed from here to see and parse the XML tree/data?
>>>> Most probably you don't need to parse anything, as $a already contain
>>>> final result from soap call.
>>>> use Data::Dumper;
>>>> print Dumper $a
>>> Matija
>>> Thanks for the quick response.
>>> However, it seems that the Dumper returns only the last item in the
>>> list.
>> Why do you jump to this conclusion rather than guess that the thing
>> that Dumper is trying to dump only has the last item?
>
> I don't know Perl well enough and Dumper in particular. That leaves
> me with only one option - make assumptions and respectfully ask for
> help.
>
Your problem may be not with Dumper but with the way you are using
SOAP::Lite - try this:
my $response = $soap->call($retrieveXmlList => @params);
my @results = $response->result; # 1st returned value
print "\n1.\n", Dumper(@results);
@results = $response->paramsout; # 2nd ... returned values
print "\n2.\n", Dumper(@results)
@results = $reponse->paramsall; # 1st, 2nd ... returned values
print "\n3.\n", Dumper(@results);
--
RGB
Re: SOAP
am 09.04.2008 18:30:44 von KevinO
On Apr 9, 11:27 am, RedGrittyBrick
wrote:
> KevinO wrote:
> > On Apr 9, 11:07 am, nolo contendere wrote:
> >> On Apr 9, 11:03 am, KevinO wrote:
>
> >>> On Apr 9, 9:40 am, Matija Papec wrote:
> >>>> KevinO wrote:
> >>>>> Hi
> >>>>> I "inherited" a program which contains this line:
> >>>>> $a = $soap->call( $retrieveXmlList => @params )->result ;
> >>>>> I added:
> >>>>> print "$a\n" ;
> >>>>> Which produced:
> >>>>> HASH(0x50c5d4)
> >>>>> How do I proceed from here to see and parse the XML tree/data?
> >>>> Most probably you don't need to parse anything, as $a already contain
> >>>> final result from soap call.
> >>>> use Data::Dumper;
> >>>> print Dumper $a
> >>> Matija
> >>> Thanks for the quick response.
> >>> However, it seems that the Dumper returns only the last item in the
> >>> list.
> >> Why do you jump to this conclusion rather than guess that the thing
> >> that Dumper is trying to dump only has the last item?
>
> > I don't know Perl well enough and Dumper in particular. That leaves
> > me with only one option - make assumptions and respectfully ask for
> > help.
>
> Your problem may be not with Dumper but with the way you are using
> SOAP::Lite - try this:
>
> my $response = $soap->call($retrieveXmlList => @params);
>
> my @results = $response->result; # 1st returned value
> print "\n1.\n", Dumper(@results);
>
> @results = $response->paramsout; # 2nd ... returned values
> print "\n2.\n", Dumper(@results)
>
> @results = $reponse->paramsall; # 1st, 2nd ... returned values
> print "\n3.\n", Dumper(@results);
>
> --
> RGB
RGB
First - THANKS.
(1.) returns the last item in the list.
(2.) returns nothing, no error message.
(3.) returns nothing + this error message: "Can't call method
"paramsall" on an undefined value at retrieveXmlList.pl line 38."
KO
Re: SOAP
am 09.04.2008 18:50:54 von RedGrittyBrick
KevinO wrote:
> On Apr 9, 11:27 am, RedGrittyBrick
> wrote:
>> KevinO wrote:
>>> On Apr 9, 11:07 am, nolo contendere wrote:
>>>> On Apr 9, 11:03 am, KevinO wrote:
>>>>> On Apr 9, 9:40 am, Matija Papec wrote:
>>>>>> KevinO wrote:
>>>>>>> Hi
>>>>>>> I "inherited" a program which contains this line:
>>>>>>> $a = $soap->call( $retrieveXmlList => @params )->result ;
>>>>>>> I added:
>>>>>>> print "$a\n" ;
>>>>>>> Which produced:
>>>>>>> HASH(0x50c5d4)
>>>>>>> How do I proceed from here to see and parse the XML tree/data?
>>>>>> Most probably you don't need to parse anything, as $a already contain
>>>>>> final result from soap call.
>>>>>> use Data::Dumper;
>>>>>> print Dumper $a
>>>>> Matija
>>>>> Thanks for the quick response.
>>>>> However, it seems that the Dumper returns only the last item in the
>>>>> list.
>>>> Why do you jump to this conclusion rather than guess that the thing
>>>> that Dumper is trying to dump only has the last item?
>>> I don't know Perl well enough and Dumper in particular. That leaves
>>> me with only one option - make assumptions and respectfully ask for
>>> help.
>> Your problem may be not with Dumper but with the way you are using
>> SOAP::Lite - try this:
>>
>> my $response = $soap->call($retrieveXmlList => @params);
>>
>> my @results = $response->result; # 1st returned value
>> print "\n1.\n", Dumper(@results);
>>
>> @results = $response->paramsout; # 2nd ... returned values
>> print "\n2.\n", Dumper(@results)
>>
>> @results = $reponse->paramsall; # 1st, 2nd ... returned values
>> print "\n3.\n", Dumper(@results);
>>
>
> First - THANKS.
>
> (1.) returns the last item in the list.
> (2.) returns nothing, no error message.
> (3.) returns nothing + this error message: "Can't call method
> "paramsall" on an undefined value at retrieveXmlList.pl line 38."
>
Hmm, I think there is something wrong with your server, not with your
client.
Change the client so that where you define your "$soap" you make a
change like
from
use SOAP::Lite +autodispatch =>
uri => 'http://www.jmac.org/ISBN',
proxy => 'http://www.jmac.org/projects/bookdb/isbn/lookup.pl';
to
use SOAP::Lite +autodispatch =>
uri => 'http://www.jmac.org/ISBN',
outputxml => 1,
proxy => 'http://www.jmac.org/projects/bookdb/isbn/lookup.pl';
In other words, use the outputxml option.
Post the XML results here (sanitized if need be) - it will show exactly
what your server is sending.
--
RGB
Re: SOAP
am 09.04.2008 18:57:04 von xhoster
KevinO wrote:
> >
> > Your problem may be not with Dumper but with the way you are using
> > SOAP::Lite - try this:
> >
> > my $response = $soap->call($retrieveXmlList => @params);
> >
> > my @results = $response->result; # 1st returned value
> > print "\n1.\n", Dumper(@results);
> >
> > @results = $response->paramsout; # 2nd ... returned values
> > print "\n2.\n", Dumper(@results)
> >
> > @results = $reponse->paramsall; # 1st, 2nd ... returned values
> > print "\n3.\n", Dumper(@results);
> >
> > --
> > RGB
>
> RGB
>
> First - THANKS.
>
> (1.) returns the last item in the list.
How do you know it is the last item, rather than the *only* item,
in the list? The first step to debugging is the verify that there
is a bug. Maybe the error is in your expectations. Can you come up with
any example code which proves that there is more than one item to be found?
Xho
--
-------------------- http://NewsReader.Com/ --------------------
The costs of publication of this article were defrayed in part by the
payment of page charges. This article must therefore be hereby marked
advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
this fact.