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

Re: Re: [soaplite] Parameters by name

Expand Messages
  • Duncan Cameron
    ... Michael A couple of things are not clear from your original post. Have you defined the class MyWorld to inherit from SOAP::Server::Parameters? If not, then
    Message 1 of 4 , Apr 24 12:57 PM
      On 2003-04-24 Michael Grinnell wrote:
      >Hey again,
      >
      >I've been mucking about with this issue some more, and have made little
      >progress.
      >
      >The array that it is returning a reference to contains 2 elements, the
      >names of the parameters (name1, name2). For some reason it is serializing
      >those, then the first data element, and that's it. There are only 2
      >parameters being returned.
      >Passing parameters by order (my ($name1, $name2) = @_) works just fine.
      >
      >Anybody have any ideas? I'm creating a function that can take up to 12
      >parameters, and passing parameters by order will make it too unwieldy to
      >use.
      >
      >TIA
      >
      >Michael Grinnell
      >Network Security Analyst
      >The American University
      >e-mail: grinnell@...
      >
      >
      >|---------+---------------------------->
      >| | "Michael |
      >| | Grinnell" |
      >| | <mg8981b@american|
      >| | .edu> |
      >| | |
      >| | 04/22/2003 10:06 |
      >| | PM |
      >| | |
      >|---------+---------------------------->
      > >-------------------------------------------------------------------------------------------------------------------------------|
      > | |
      > | To: soaplite@yahoogroups.com |
      > | cc: |
      > | Subject: [soaplite] Parameters by name |
      > >-------------------------------------------------------------------------------------------------------------------------------|
      >
      >
      >
      >
      >
      >Hi all,
      >
      >I'm having problems grabbing parameters by name from the client. I have
      >created a module, MyWorld, containing a function, MyGoodBye, which is
      >loosely patterned after My::Parameters::byname() (from the examples
      >directory). It's supposed to return "Goodbye, foo and bar" where foo and
      >bar are names passed in the client. Unfortunately, what it returns is
      >"Goodbye, ARRAY(0x4846bc) and foo". I have tried various permutations in
      >the function, but nothing I've tried yet seems to work.
      >
      >I have included snippets from my code below. I can send the full files if
      >needed. Thanks for any help,
      >
      >
      >
      >
      >MyWorld.pm
      >#####
      >sub MyGoodBye {
      > my $self = shift;
      > my ($name1, $name2) = SOAP::Server::Parameters::byName([qw(name1
      >name2)], @_);
      > return "Goodbye, $name1 and $name2\n";
      >}
      >
      >client.pl
      >#####
      >use SOAP::Lite;
      >
      >my $soap = SOAP::Lite
      > -> service('http://esol.american.edu:8080/wsdl/MyWorld.wsdl');
      >my @names = (
      > SOAP::Data->name(name1 => "foo"),
      > SOAP::Data->name(name2 => "bar")
      >);
      >print "MyGoodBye()\n";
      >print $soap->MyGoodBye(@names);

      Michael

      A couple of things are not clear from your original post.

      Have you defined the class MyWorld to inherit from SOAP::Server::Parameters?
      If not, then you need to do that.

      Are you running with warnings enabled?

      Regards,
      Duncan
    • Michael Grinnell
      Duncan, Thanks, I overlooked the inheritance text in the example. Once I added use vars qw(@ISA); @ISA = qw(SOAP::Server::Parameters); everything worked just
      Message 2 of 4 , Apr 24 3:41 PM
        Duncan,

        Thanks, I overlooked the inheritance text in the example.  Once I added

        use vars qw(@ISA);
        @ISA = qw(SOAP::Server::Parameters);

        everything worked just fine.

        Thanks again,

        Michael Grinnell
        Network Security Analyst
        The American University
        e-mail: grinnell@...



        Duncan Cameron <dcameron@...>

        04/24/2003 03:57 PM

               
                To:        Michael Grinnell <mg8981b@...>, soaplite@yahoogroups.com <soaplite@yahoogroups.com>
                cc:        
                Subject:        Re: Re: [soaplite] Parameters by name



        On 2003-04-24 Michael Grinnell wrote:
        >Hey again,
        >
        >I've been mucking about with this issue some more, and have made little
        >progress.
        >
        >The array that it is returning a reference to contains 2 elements,
        the
        >names of the parameters (name1, name2).  For some reason it is
        serializing
        >those, then the first data element, and that's it.  There are
        only 2
        >parameters being returned.
        >Passing parameters by order (my ($name1, $name2) = @_) works just fine.
        >
        >Anybody have any ideas?  I'm creating a function that can take
        up to 12
        >parameters, and passing parameters by order will make it too unwieldy
        to
        >use.
        >
        >TIA
        >
        >Michael Grinnell
        >Network Security Analyst
        >The American University
        >e-mail: grinnell@...
        >
        >
        >|---------+---------------------------->
        >|         |          
        "Michael         |
        >|         |          
        Grinnell"        |
        >|         |          
        <mg8981b@american|
        >|         |          
        .edu>            |
        >|         |          
                         |
        >|         |          
        04/22/2003 10:06 |
        >|         |          
        PM               |
        >|         |          
                         |
        >|---------+---------------------------->
        >  >-------------------------------------------------------------------------------------------------------------------------------|
        >  |                  
                                                                                                                    |
        >  |       To:       soaplite@yahoogroups.com
                                                                                             |
        >  |       cc:          
                                                                                                                  |
        >  |       Subject:  [soaplite] Parameters
        by name                                                                                 |
        >  >-------------------------------------------------------------------------------------------------------------------------------|
        >
        >
        >
        >
        >
        >Hi all,
        >
        >I'm having problems grabbing parameters by name from the client.  I
        have
        >created a module, MyWorld, containing a function, MyGoodBye, which
        is
        >loosely patterned after My::Parameters::byname() (from the examples
        >directory).  It's supposed to return "Goodbye, foo and bar"
        where foo and
        >bar are names passed in the client.  Unfortunately, what it returns
        is
        >"Goodbye, ARRAY(0x4846bc) and foo".  I have tried various
        permutations in
        >the function, but nothing I've tried yet seems to work.
        >
        >I have included snippets from my code below.  I can send the full
        files if
        >needed.  Thanks for any help,
        >
        >
        >
        >
        >MyWorld.pm
        >#####
        >sub MyGoodBye {
        >   my $self = shift;
        >   my ($name1, $name2) = SOAP::Server::Parameters::byName([qw(name1
        >name2)], @_);
        >   return "Goodbye, $name1 and $name2\n";
        >}
        >
        >client.pl
        >#####
        >use SOAP::Lite;
        >
        >my $soap = SOAP::Lite
        >   -> service('http://esol.american.edu:8080/wsdl/MyWorld.wsdl');
        >my @names = (
        >   SOAP::Data->name(name1 => "foo"),
        >   SOAP::Data->name(name2 => "bar")
        >);
        >print "MyGoodBye()\n";
        >print $soap->MyGoodBye(@names);

        Michael

        A couple of things are not clear from your original post.

        Have you defined the class MyWorld to inherit from SOAP::Server::Parameters?
        If not, then you need to do that.

        Are you running with warnings enabled?

        Regards,
        Duncan






        ------------------------ Yahoo! Groups Sponsor ---------------------~-->
        Get 128 Bit SSL Encryption!
        http://us.click.yahoo.com/xaxhjB/hdqFAA/bW3JAA/W6uqlB/TM
        ---------------------------------------------------------------------~->

        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/



      Your message has been successfully submitted and would be delivered to recipients shortly.