Loading ...
Sorry, an error occurred while loading the content.
 

Re: Can the server process parameters by name?

Expand Messages
  • One4K4
    Yes, yes it should. I m left handed. ;) ... http://docs.yahoo.com/info/terms/
    Message 1 of 26 , Jun 13, 2002
      Yes, yes it should. I'm left handed. ;)

      --- In soaplite@y..., Keanan Smith <KSmith@n...> wrote:
      > Err shouldn't that be:
      >
      > sub bynameGetAcctNumber {
      > my $self = shift;
      > my %args = (@_);
      > GetAcctNumber(name=>$args{name},ss=>$args{ss});
      > }
      >
      > (Note the % on the 1st args)
      > ??
      > -----Original Message-----
      > From: One4K4 [mailto:one4k4@y...]
      > Sent: Thursday, June 13, 2002 8:23 AM
      > To: soaplite@y...
      > Subject: [soaplite] Re: Can the server process parameters by name?
      >
      >
      > Maybe an option would be to have little "wrapper" subroutines:
      >
      > sub byposGetAcctNumber {
      > my $self = shift;
      > my ($name,$ss) = @_;
      > GetAcctNumber(name=>$name,ss=>$ss);
      > }
      >
      > sub bynameGetAcctNumber {
      > my $self = shift;
      > my $args = (@_);
      > GetAcctNumber(name=>$args{name},ss=>$args{ss});
      > }
      >
      > ? Just my $0.02;
      >
      > -Tom
      >
      > --- In soaplite@y..., "Chris Davies" <Chris.Davies@M...> wrote:
      > > Actually that quote was from me, but no matter. Thanks for the
      > update
      > >
      > > Regards,
      > > Chris
      > >
      > > -----Original Message-----
      > > From: Paul Kulchenko [mailto:paulclinger@y...]
      > > Sent: Monday, May 14, 2001 4:24 PM
      > > To: soaplite@y...
      > > Subject: Re: [soaplite] Re: Can the server process parameters by
      > name?
      > >
      > > Hi, Ashley!
      > >
      > > > > The only way I can see of solving this is to look for the
      > > > mandatory
      > > > > parameter names, and if you find any of them then assume the
      > > > > parameters have been passed by name. Ugh!
      >
      >
      >
      > To unsubscribe from this group, send an email to:
      > soaplite-unsubscribe@y...
      >
      >
      >
      > Your use of Yahoo! Groups is subject to
      http://docs.yahoo.com/info/terms/
    • One4K4
      ... Every method on server side will be called as class/object method, so it will get an object reference or a class name as the first parameter, then the
      Message 2 of 26 , Jun 13, 2002
        From the SOAP::Lite pod docs:
        ------------------------------------------------------
        Every method on server side will be called as class/object method, so
        it will get an object reference or a class name as the first
        parameter, then the method parameters, and then an envelope as
        SOAP::SOM object. Shortly:

        $self [, @parameters] , $envelope

        If you have a fixed number of parameters, you can do:

        my $self = shift;
        my($param1, $param2) = @_;

        and ignore the envelope. If you need access to the envelope you can
        do:

        my $envelope = pop;

        since the envelope is always the last element in the parameters list.
        The byname() method pop->method will return a hash with parameter
        names as hash keys and parameter values as hash values:

        my($a, $b, $c) = @{pop->method}{qw(a b c)};

        gives you by-name access to your parameters.
        ------------------------------------------------------

        my($a, $b, $c) = @{pop->method}{qw(a b c)};
        I've tried that... but for some reason there is *no envelope* at the
        end of @_ ?!

        -Tom


        --- In soaplite@y..., "Chris Davies" <Chris.Davies@M...> wrote:
        > I'm using a SOAP::Lite server with version 0.46 of SOAP::Lite.
        >
        > My colleagues in a.n.other company want to use named parameters
        (rather than
        > positional ones) to talk to my SOAP::Lite server. They are using
        MS .NET,
        > and we're around most of the interoperability issues now. Is it
        easy for a
        > SOAP::Lite server to handle named parameters, and if so how do I
        approach
        > the problem?
        >
        > Thanks,
        > Chris
        > --
        > Chris Davies, Manheim Interactive (Europe)
        > Tel. 0870 444-0450 Fax. 0870 444-0482 Email. MOL@M...
      • One4K4
        FYI: You need: package Foo; @Foo::ISA = SOAP::Server::Parameters ; At the top of your package declration. *If* you re dynamically/non- statically
        Message 3 of 26 , Jun 13, 2002
          FYI: You need:

          package Foo;
          @Foo::ISA = 'SOAP::Server::Parameters';

          At the top of your package declration. *If* you're dynamically/non-
          statically dispatching.

          -Tom

          --- In soaplite@y..., "One4K4" <one4k4@y...> wrote:
          > From the SOAP::Lite pod docs:
          > ------------------------------------------------------
          > Every method on server side will be called as class/object method,
          so
          > it will get an object reference or a class name as the first
          > parameter, then the method parameters, and then an envelope as
          > SOAP::SOM object. Shortly:
          >
          > $self [, @parameters] , $envelope
          >
          > If you have a fixed number of parameters, you can do:
          >
          > my $self = shift;
          > my($param1, $param2) = @_;
          >
          > and ignore the envelope. If you need access to the envelope you can
          > do:
          >
          > my $envelope = pop;
          >
          > since the envelope is always the last element in the parameters
          list.
          > The byname() method pop->method will return a hash with parameter
          > names as hash keys and parameter values as hash values:
          >
          > my($a, $b, $c) = @{pop->method}{qw(a b c)};
          >
          > gives you by-name access to your parameters.
          > ------------------------------------------------------
          >
          > my($a, $b, $c) = @{pop->method}{qw(a b c)};
          > I've tried that... but for some reason there is *no envelope* at
          the
          > end of @_ ?!
          >
          > -Tom
          >
          >
          > --- In soaplite@y..., "Chris Davies" <Chris.Davies@M...> wrote:
          > > I'm using a SOAP::Lite server with version 0.46 of SOAP::Lite.
          > >
          > > My colleagues in a.n.other company want to use named parameters
          > (rather than
          > > positional ones) to talk to my SOAP::Lite server. They are using
          > MS .NET,
          > > and we're around most of the interoperability issues now. Is it
          > easy for a
          > > SOAP::Lite server to handle named parameters, and if so how do I
          > approach
          > > the problem?
          > >
          > > Thanks,
          > > Chris
          > > --
          > > Chris Davies, Manheim Interactive (Europe)
          > > Tel. 0870 444-0450 Fax. 0870 444-0482 Email. MOL@M...
        • Keanan Smith
          You will get this functionality ONLY if you inherit your class from the SOAP::Server::Parameters class. This should keep existing code working and provides
          Message 4 of 26 , Jun 13, 2002
            "You will get this functionality ONLY if you inherit your class from the
            SOAP::Server::Parameters class. This should keep existing code working and
            provides this feature only when you need it."

            I think this may be what you are looking for...

            -----Original Message-----
            From: One4K4 [mailto:one4k4@...]
            Sent: Thursday, June 13, 2002 8:51 AM
            To: soaplite@yahoogroups.com
            Subject: [soaplite] Re: Can the server process parameters by name?


            From the SOAP::Lite pod docs:
            ------------------------------------------------------
            Every method on server side will be called as class/object method, so
            it will get an object reference or a class name as the first
            parameter, then the method parameters, and then an envelope as
            SOAP::SOM object. Shortly:

            $self [, @parameters] , $envelope

            If you have a fixed number of parameters, you can do:

            my $self = shift;
            my($param1, $param2) = @_;

            and ignore the envelope. If you need access to the envelope you can
            do:

            my $envelope = pop;

            since the envelope is always the last element in the parameters list.
            The byname() method pop->method will return a hash with parameter
            names as hash keys and parameter values as hash values:

            my($a, $b, $c) = @{pop->method}{qw(a b c)};

            gives you by-name access to your parameters.
            ------------------------------------------------------

            my($a, $b, $c) = @{pop->method}{qw(a b c)};
            I've tried that... but for some reason there is *no envelope* at the
            end of @_ ?!

            -Tom


            --- In soaplite@y..., "Chris Davies" <Chris.Davies@M...> wrote:
            > I'm using a SOAP::Lite server with version 0.46 of SOAP::Lite.
            >
            > My colleagues in a.n.other company want to use named parameters
            (rather than
            > positional ones) to talk to my SOAP::Lite server. They are using
            MS .NET,
            > and we're around most of the interoperability issues now. Is it
            easy for a
            > SOAP::Lite server to handle named parameters, and if so how do I
            approach
            > the problem?
            >
            > Thanks,
            > Chris
            > --
            > Chris Davies, Manheim Interactive (Europe)
            > Tel. 0870 444-0450 Fax. 0870 444-0482 Email. MOL@M...



            To unsubscribe from this group, send an email to:
            soaplite-unsubscribe@yahoogroups.com



            Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
          • One4K4
            Yeap, that did it... consider: package DocPub; @DocPub::ISA = SOAP::Server::Parameters ; Which solved my problem, using the pod doc s code sample. Thanks!
            Message 5 of 26 , Jun 13, 2002
              Yeap, that did it... consider:

              package DocPub;
              @DocPub::ISA = 'SOAP::Server::Parameters';

              Which solved my problem, using the pod doc's code sample.

              Thanks!

              -Tom

              --- In soaplite@y..., Keanan Smith <KSmith@n...> wrote:
              > "You will get this functionality ONLY if you inherit your class
              from the
              > SOAP::Server::Parameters class. This should keep existing code
              working and
              > provides this feature only when you need it."
              >
              > I think this may be what you are looking for...
              >
              > -----Original Message-----
              > From: One4K4 [mailto:one4k4@y...]
              > Sent: Thursday, June 13, 2002 8:51 AM
              > To: soaplite@y...
              > Subject: [soaplite] Re: Can the server process parameters by name?
              >
              >
              > From the SOAP::Lite pod docs:
              > ------------------------------------------------------
              > Every method on server side will be called as class/object method,
              so
              > it will get an object reference or a class name as the first
              > parameter, then the method parameters, and then an envelope as
              > SOAP::SOM object. Shortly:
              >
              > $self [, @parameters] , $envelope
              >
              > If you have a fixed number of parameters, you can do:
              >
              > my $self = shift;
              > my($param1, $param2) = @_;
              >
              > and ignore the envelope. If you need access to the envelope you can
              > do:
              >
              > my $envelope = pop;
              >
              > since the envelope is always the last element in the parameters
              list.
              > The byname() method pop->method will return a hash with parameter
              > names as hash keys and parameter values as hash values:
              >
              > my($a, $b, $c) = @{pop->method}{qw(a b c)};
              >
              > gives you by-name access to your parameters.
              > ------------------------------------------------------
              >
              > my($a, $b, $c) = @{pop->method}{qw(a b c)};
              > I've tried that... but for some reason there is *no envelope* at
              the
              > end of @_ ?!
              >
              > -Tom
              >
              >
              > --- In soaplite@y..., "Chris Davies" <Chris.Davies@M...> wrote:
              > > I'm using a SOAP::Lite server with version 0.46 of SOAP::Lite.
              > >
              > > My colleagues in a.n.other company want to use named parameters
              > (rather than
              > > positional ones) to talk to my SOAP::Lite server. They are using
              > MS .NET,
              > > and we're around most of the interoperability issues now. Is it
              > easy for a
              > > SOAP::Lite server to handle named parameters, and if so how do I
              > approach
              > > the problem?
              > >
              > > Thanks,
              > > Chris
              > > --
              > > Chris Davies, Manheim Interactive (Europe)
              > > Tel. 0870 444-0450 Fax. 0870 444-0482 Email. MOL@M...
              >
              >
              >
              > To unsubscribe from this group, send an email to:
              > soaplite-unsubscribe@y...
              >
              >
              >
              > Your use of Yahoo! Groups is subject to
              http://docs.yahoo.com/info/terms/
            • Paul Kulchenko
              Hi, Tom! There are also byName and byNameOrOrder functions (Randy Ray made a great suggestion to make them methods instead of functions) in
              Message 6 of 26 , Jun 13, 2002
                Hi, Tom!

                There are also byName and byNameOrOrder functions (Randy Ray made a
                great suggestion to make them methods instead of functions) in
                SOAP::Server::Parameters class that allow you to do this:

                my $self = shift;
                my($a, $b, $c) = SOAP::Server::Parameters::byName([qw(a b c)], @_);

                Take a look at \examples\My\Parameters.pm for more details.

                Best wishes, Paul.

                --- One4K4 <one4k4@...> wrote:
                > Yeap, that did it... consider:
                >
                > package DocPub;
                > @DocPub::ISA = 'SOAP::Server::Parameters';
                >
                > Which solved my problem, using the pod doc's code sample.
                >
                > Thanks!
                >
                > -Tom
                >
                > --- In soaplite@y..., Keanan Smith <KSmith@n...> wrote:
                > > "You will get this functionality ONLY if you inherit your class
                > from the
                > > SOAP::Server::Parameters class. This should keep existing code
                > working and
                > > provides this feature only when you need it."
                > >
                > > I think this may be what you are looking for...
                > >
                > > -----Original Message-----
                > > From: One4K4 [mailto:one4k4@y...]
                > > Sent: Thursday, June 13, 2002 8:51 AM
                > > To: soaplite@y...
                > > Subject: [soaplite] Re: Can the server process parameters by
                > name?
                > >
                > >
                > > From the SOAP::Lite pod docs:
                > > ------------------------------------------------------
                > > Every method on server side will be called as class/object
                > method,
                > so
                > > it will get an object reference or a class name as the first
                > > parameter, then the method parameters, and then an envelope as
                > > SOAP::SOM object. Shortly:
                > >
                > > $self [, @parameters] , $envelope
                > >
                > > If you have a fixed number of parameters, you can do:
                > >
                > > my $self = shift;
                > > my($param1, $param2) = @_;
                > >
                > > and ignore the envelope. If you need access to the envelope you
                > can
                > > do:
                > >
                > > my $envelope = pop;
                > >
                > > since the envelope is always the last element in the parameters
                > list.
                > > The byname() method pop->method will return a hash with parameter
                >
                > > names as hash keys and parameter values as hash values:
                > >
                > > my($a, $b, $c) = @{pop->method}{qw(a b c)};
                > >
                > > gives you by-name access to your parameters.
                > > ------------------------------------------------------
                > >
                > > my($a, $b, $c) = @{pop->method}{qw(a b c)};
                > > I've tried that... but for some reason there is *no envelope* at
                > the
                > > end of @_ ?!
                > >
                > > -Tom
                > >
                > >
                > > --- In soaplite@y..., "Chris Davies" <Chris.Davies@M...> wrote:
                > > > I'm using a SOAP::Lite server with version 0.46 of SOAP::Lite.
                > > >
                > > > My colleagues in a.n.other company want to use named parameters
                >
                > > (rather than
                > > > positional ones) to talk to my SOAP::Lite server. They are
                > using
                > > MS .NET,
                > > > and we're around most of the interoperability issues now. Is it
                >
                > > easy for a
                > > > SOAP::Lite server to handle named parameters, and if so how do
                > I
                > > approach
                > > > the problem?
                > > >
                > > > Thanks,
                > > > Chris
                > > > --
                > > > Chris Davies, Manheim Interactive (Europe)
                > > > Tel. 0870 444-0450 Fax. 0870 444-0482 Email. MOL@M...
                > >
                > >
                > >
                > > To unsubscribe from this group, send an email to:
                > > soaplite-unsubscribe@y...
                > >
                > >
                > >
                > > Your use of Yahoo! Groups is subject to
                > http://docs.yahoo.com/info/terms/
                >
                >
                > ------------------------ Yahoo! Groups Sponsor
                >
                > To unsubscribe from this group, send an email to:
                > soaplite-unsubscribe@yahoogroups.com
                >
                >
                >
                > Your use of Yahoo! Groups is subject to
                > http://docs.yahoo.com/info/terms/
                >
                >


                __________________________________________________
                Do You Yahoo!?
                Yahoo! - Official partner of 2002 FIFA World Cup
                http://fifaworldcup.yahoo.com
              Your message has been successfully submitted and would be delivered to recipients shortly.