Re: using SOAP::SOM to parse a LWP::UserAgent response

J Cook <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.lwp
Message-ID <[email protected]>
Garry T. Williams wrote:
> On Monday 06 November 2006 17:26, J Cook wrote:
>   
>> Hi,
>>
>> I have a LWP::UserAgent request that I want the response to become a 
>> SOAP::SOM object. Is this possible?
>>
>> I've tried the following but got a weird SOAP/Lite error:
>>
>> $response = $ua->request($request);
>> $som = SOAP::SOM->new($response->content());
>> print $som->valueof('//Result/Data');
>>     
>
> Of course this might be easier, if you included the text of the error
> you refer to.  :-)
>   
    Yes, it might help;) - I got the following:
Can't use string ("<?xml version="1.0" encoding="ut") as an ARRAY ref 
while "strict refs" in use at /usr/local/share/perl/5.8.7/SOAP/Lite.pm 
line 459.


>> Any suggestions?
>>     
>
> Any reason you're not just using SOAP::Lite to access the service
> directly?  It uses LWP under its covers.
>   
    Because its not a simple SOAP call and its easier for me to roll it 
myself since that's how the person who wrote the service recommends 
doing it. But it would be nice to get the response back where its easily 
parsable.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.