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

Parameters by name

Expand Messages
  • Michael Grinnell
    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
    Message 1 of 4 , Apr 22, 2003
    • 0 Attachment

      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 bar".  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);

      MyWorld.wsdl
      <?xml version="1.0" encoding="UTF-8"?>
      <definitions name="MyWorld"
        targetNamespace="http://esol.american.edu:8080/wsdl/MyWorld.wsdl"
        xmlns="http://schemas.xmlsoap.org/wsdl/"
        xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
        xmlns:tns="http://esol.american.edu:8080/wsdl/MyWorld.wsdl"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema">
        <message name="MyGoodByeRequest">
            <part name="name1" type="xsd:string"/>
            <part name="name2" type="xsd:string"/>
        </message>
        <message name="MyGoodByeResponse">
           <part name="salutation" type="xsd:string"/>
        </message>  
        ...
        <portType name="MyWorld_portType">
           <operation name="MyGoodBye">
              <input message="tns:MyGoodByeRequest"/>
              <output message="tns:MyGoodByeResponse"/>
           </operation>
        </portType>
        ...  
        <binding name="MyWorld_Binding" type="tns:MyWorld_portType">
           <soap:binding style="rpc"
              transport="http://schemas.xmlsoap.org/soap/http"/>
           <operation name="MyGoodBye">
              <soap:operation soapAction="MyWorld#MyGoodBye"/>
              <input>
                 <soap:body
                    encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                             namespace="MyWorld"
                    use="encoded"/>
              </input>
              <output>
                 <soap:body
                    encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                             namespace="MyWorld"
                    use="encoded"/>
              </output>
           </operation>
        </binding>
        <service name="MyWorld">
           <documentation>Slightly more complicated Hello World SOAP Service</documentation>
           <port binding="tns:MyWorld_Binding" name="MyWorld_Port">
              <soap:address
                 location="http://esol.american.edu:8080/soap"/>
           </port>
        </service>
      </definitions>

       



      Michael Grinnell
      Network Security Analyst
      The American University
      e-mail: grinnell@...
    • Michael Grinnell
      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,
      Message 2 of 4 , Apr 24, 2003
      • 0 Attachment
        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);

        MyWorld.wsdl
        <?xml version="1.0" encoding="UTF-8"?>
        <definitions name="MyWorld"
        targetNamespace="http://esol.american.edu:8080/wsdl/MyWorld.wsdl"
        xmlns="http://schemas.xmlsoap.org/wsdl/"
        xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
        xmlns:tns="http://esol.american.edu:8080/wsdl/MyWorld.wsdl"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema">
        <message name="MyGoodByeRequest">
        <part name="name1" type="xsd:string"/>
        <part name="name2" type="xsd:string"/>
        </message>
        <message name="MyGoodByeResponse">
        <part name="salutation" type="xsd:string"/>
        </message>
        ...
        <portType name="MyWorld_portType">
        <operation name="MyGoodBye">
        <input message="tns:MyGoodByeRequest"/>
        <output message="tns:MyGoodByeResponse"/>
        </operation>
        </portType>
        ...
        <binding name="MyWorld_Binding" type="tns:MyWorld_portType">
        <soap:binding style="rpc"
        transport="http://schemas.xmlsoap.org/soap/http"/>
        <operation name="MyGoodBye">
        <soap:operation soapAction="MyWorld#MyGoodBye"/>
        <input>
        <soap:body
        encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
        namespace="MyWorld"
        use="encoded"/>
        </input>
        <output>
        <soap:body
        encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
        namespace="MyWorld"
        use="encoded"/>
        </output>
        </operation>
        </binding>
        <service name="MyWorld">
        <documentation>Slightly more complicated Hello World SOAP
        Service</documentation>
        <port binding="tns:MyWorld_Binding" name="MyWorld_Port">
        <soap:address
        location="http://esol.american.edu:8080/soap"/>
        </port>
        </service>
        </definitions>





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

        Yahoo! Groups Sponsor











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



        Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
      • 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 3 of 4 , Apr 24, 2003
        • 0 Attachment
          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 4 of 4 , Apr 24, 2003
          • 0 Attachment
            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.