http://qs321.pair.com?node_id=874652

g0n has asked for the wisdom of the Perl Monks concerning the following question:

Esteemed Monks

I'm trying to do a bit of basic evaluation of Perl SOAP modules for a task. I seem to be failing at the first hurdle. My code is as follows:

Server:

use strict; use warnings; use Data::Dumper; use SOAP::Transport::HTTP; SOAP::Transport::HTTP::CGI -> dispatch_to('Demo') -> handle; package Demo; sub hi { return "hello, world"; } sub bye { return "goodbye, cruel world"; }
(Taken from http://www.perl.com/pub/2001/01/soap.html - it's quite an old example but other examples appear similar)

This is running as a cgi script in an Apache 1.3, mod_perl environment.

client:

use strict; use warnings; use SOAP::Lite; print SOAP::Lite -> uri('http://myserver.manheim.co.uk:51111/webservices/vehicle') + -> proxy('http://myserver.manheim.co.uk:51111/webservices/vehicle/ +soaptest.pl') -> hi() -> result;

When I run the client, nothing happens for a long while, then I get the following message:

[Tue Nov 30 13:44:40 2010] 15689 Digit.pl: Deep recursion on subroutin +e "utf8::SWASHNEW" at /usr/share/perl/5.10/utf8_heavy.pl line 251. [Tue Nov 30 13:44:40 2010] 15689 Digit.pl: Deep recursion on subroutin +e "CGI::Carp::die" at /usr/share/perl/5.10/utf8_heavy.pl line 198.

I found a suggestion (can't find the URL now) that this is a script error, which sends carp/die into a tailspin, but haven't been able to find a way of tracking down what's wrong with it.

Can anyone suggest a way past this?

Update:

kcotts comment has solved my problem - replacing uri('http://myserver.manheim.co.uk:51111/webservices/vehicle' with uri('http://myserver.manheim.co.uk:51111/Demo' made the thing work immediately. Thanks Corion & ruoso - I'll investigate alternatives to SOAP::Lite.

--------------------------------------------------------------

"If there is such a phenomenon as absolute evil, it consists in treating another human being as a thing."
John Brunner, "The Shockwave Rider".

Replies are listed 'Best First'.
Re: Deep recursion problem with SOAP
by Corion (Patriarch) on Dec 01, 2010 at 12:17 UTC

    I assume that somewhere, something is in an encoding, and something tries to decode that in the wrong way. Maybe the data is marked as UTF-8, but sent as "something else". Can you take mod_perl/Apache::Registry out of the picture, or is it not in the picture at all?

    As a second stab, I would try to look at the data going back and forth either with Wireshark or with SOAP::Trace to get a better picture of what might happen when.

    Also see this (somewhat disheartening) part in the "Troubleshooting" section of SOAP::Lite:

    Using SOAP::Lite (or XML::Parser::Expat) in combination with mod_perl causes random segmentation faults in httpd processes.
Re: Deep recursion problem with SOAP
by kcott (Archbishop) on Dec 01, 2010 at 12:26 UTC

    Taking a quick look at the article you linked to, it has: "The uri() identifies the class to the server ..." with examples like:

    uri('http://www.soaplite.com/Demo') uri('http://www.soaplite.com/Temperatures')

    Perhaps that's where the problem lies.

    -- Ken

Re: Deep recursion problem with SOAP
by ruoso (Curate) on Dec 01, 2010 at 15:59 UTC

    I've been dealing with SOAP for a while already and I must say that the module you should use is XML::Compile::SOAP. Or, if possible, SOAP::Simple (which is just an abstraction for it). If you want to make a web app with support for web services, I'd recommend using Catalyst with Catalyst::Controller::SOAP. (If you're in Catalyst, you can also use Catalyst::Model::SOAP to consume web services).

    SOAP::Lite is relevant in archeological terms, but it doesn't implement SOAP as it has been used in the last decade.

    daniel