Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Deep recursion problem with SOAP

by g0n (Priest)
on Dec 01, 2010 at 12:00 UTC ( #874652=perlquestion: print w/replies, xml ) Need Help??
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:


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 - 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.


use strict; use warnings; use SOAP::Lite; print SOAP::Lite -> uri('') + -> proxy('') -> 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 Deep recursion on subroutin +e "utf8::SWASHNEW" at /usr/share/perl/5.10/ line 251. [Tue Nov 30 13:44:40 2010] 15689 Deep recursion on subroutin +e "CGI::Carp::die" at /usr/share/perl/5.10/ 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?


kcotts comment has solved my problem - replacing uri('' with uri('' 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 (Pope) 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 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.

Re: Deep recursion problem with SOAP
by kcott (Canon) 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('') uri('')

    Perhaps that's where the problem lies.

    -- Ken

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://874652]
Approved by marto
Front-paged by Corion
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2017-02-23 05:32 GMT
Find Nodes?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?

    Results (339 votes). Check out past polls.