Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Getting Data Names in SOAP::Lite

by Gorby (Monk)
on Jan 19, 2005 at 00:54 UTC ( [id://423233]=perlquestion: print w/replies, xml ) Need Help??

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

Hello Wise Monks,

I am writing a simple SOAP server using SOAP::Lite. The way I get values passed on to my server is the following:

sub procedure1 { @parameters=@_ }


What I'd like to do is assign names to the parameters so that SOAP clients can pass the parameters by name instead of just by order. How do I define the names in my server?

Thanks for your help in advance.

Gorby

Replies are listed 'Best First'.
Re: Getting Data Names in SOAP::Lite
by edoc (Chaplain) on Jan 19, 2005 at 01:51 UTC

    hmm.. do you mean like:

    sub procedure1{ my %parameters = @_; my $var1 = $parameters{var1}; my $var2 = $parameters{var2}; } procedure1( var1 => 'value', var2 => 'value2' );

    cheers,

    J

      In my experience, you'd need to change that slightly:
      sub procedure1{ my $class = shift; my %parameters = @_; my $var1 = $parameters{var1}; my $var2 = $parameters{var2}; } procedure1( var1 => 'value', var2 => 'value2' );
      Note the extra shift in the definition of procedure1.

      rdfield

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://423233]
Front-paged by tye
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (9)
As of 2024-04-19 16:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found