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

Hi Monks,

I am facing a problem with web services call. I am using SOAP::lite to achive this. I am parsing the parameter file and and putting it into a hash (actually hash of array. It already has few key=>value and then assigning an array to it like @{$invoke{params}}=@params;).

.

When calling SOAP::Serializer->envelope it's working fine. I am writing envelope to a file as print ENV SOAP::Serializer->envelope(method=>$methodName, @{$invoke{params}}); but after thet when I am invoking the method with "call" function as $result=$client->call($methodName => @{$invoke{params}})->result; where $client has the object for soap::.lite ... I am getting an error "404 not found".

I did investigated bit and found that, @{$invoke{params}} is giving number of parameters (like 5) instead giving the 5 parameters.

.

Is there anything I am doing wrong? Please help me to solve this. Thanks

Replies are listed 'Best First'.
Re: Problem SOAP-Lite
by SilasTheMonk (Chaplain) on Dec 18, 2009 at 23:05 UTC
    If you return an array in scalar context (as opposed to a list context) you get the number of elements in the array. So I suspect that is what you doing either in debugging or the actual code. I would probably try splitting the code out into simpler more explicit instructions.
      Hi,

      Thanks for your reply but I dont thinkm that's the problem. If it's then the envelop method also would have not worked. In case of envelop method all the parameters getting extracted out of @{invoke{parameters}} but in case of Call method it's substituting number of array elements instead of array elements. Thanks

        Then give us a runnable program that demonstrates the problem. Keep it small. 10 to 20 lines should be plenty.