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

Hi All.
I was attempting to do a dynamic soap call, eg.
my $uri = "http://127.0.0.1/cgi-bin/server.pl"; my $proxy = "http://127.0.0.1/myfn"; my $soapresponse = SOAP::Lite uri->'$uri' proxy->'$proxy' -> go($doThi +s) ->result;
but I get the response unable to determine protocol.

Also, is there a way that I could create just one soap object and keep requesting from it, eg:
$soapobject = SOAP::lite (some server, some proxy) $soapr1 = $soapobject->fn(1); $soapr2 = $soapobject->fn2(2);
Thanks. This is for some recreational programming I'm working on.
----
Zak

Replies are listed 'Best First'.
Re: Soap Questions (dynamic server, objects)
by chromatic (Archbishop) on Jun 02, 2001 at 00:14 UTC
    The SOAP::Lite Guide suggests the following syntax will create an object on which you can call remote methods:
    my $soapobj = SOAP::Lite->uri($uri)->proxy($proxy); my @results = ($soapobj->fn(1), $soapobj->fn2(2));
    In your first example above, I suspect the single quotes are ruining your fun. Perhaps something like this would work better:
    my $soapresponse = SOAP::Lite->uri->($uri) ->proxy($proxy) ->go($doThis) ->result();
    I'm not sure how the parser interprets the syntax without parenthesis, but I know the single quotes prevent variable interpolation, which is at least half the battle.
      (Stupidity) was the problem. I didn't match my parenthesis correctly... (sigh). I will (attempt) to release the code I was working on later.

      ----
      Zak