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

Re: [soaplite] Do SOAP::Lit and CGI support database-MySQL?

Expand Messages
  • Duncan Cameron
    ... Are you getting any server errors? I suggest putting the Mysoap package either *before* the call to SOAP:Transport (and then switching back to the main
    Message 1 of 5 , Sep 9, 2002
      On 2002-09-10 shihewang wrote:
      >Hello,
      >
      >Anybody knows if SOAP::Lite and CGI support database, say MySQL?
      >Please let me know.
      >
      >My test results are negative. I am not sure if my codes are correct.
      >1. SOAP::Lite
      >**************************************************************
      >**** Server
      >**************************************************************
      >#!/usr/bin/perl -w
      ># file: mysoap.cgi
      >
      > use DBI;
      > use SOAP::Transport::HTTP;
      >
      > SOAP::Transport::HTTP::CGI
      > -> dispatch_to('Mysoap')
      > -> handle;
      >
      > package Mysoap;
      >
      > sub search_db
      > {
      > use DBI;
      > my $db_name = "";
      > my $passwd = "";
      > my $login = "";
      > $dbh =DBI->connect("DBI:mysql:$db_name", $login, $passwd)
      >
      > $sth=$dbh->prepare(qq{select id from test where id =1});
      > $sth -> execute;
      > my $retval = $sth->fecthrow;
      > return $retval;
      > }
      >
      >1;
      >#end mysoap.cgi

      Are you getting any server errors?
      I suggest putting the Mysoap package either *before* the
      call to SOAP:Transport (and then switching back to the main package)
      or into a separate file.

      >**************************************************************
      >**** Client
      >**************************************************************
      >#!/usr/bin/perl -w
      ># file: test.pl
      >
      >use SOAP::Lite;
      >my $soap =SOAP::Lite
      > ->uri("urn:Mysoap")
      > ->proxy("http://www.dept.university.edu/~mylogin/cgi-
      >bin/mysoap.cgi")
      > ->hi();

      There is no hi() method in Mysoap package.

      Regards,
      Duncan Cameron
    • Shihe Wang
      Duncan, Thanks for yor response. ... there s no server msg detected. Do you mean dynamic deployment? Does it make any difference? ...
      Message 2 of 5 , Sep 10, 2002
        Duncan,
        Thanks for yor response.
        --- Duncan Cameron <dcameron@...> wrote:
        > On 2002-09-10 shihewang wrote:
        > >Hello,
        > >
        > >Anybody knows if SOAP::Lite and CGI support
        > database, say MySQL?
        > >Please let me know.
        > >
        > >My test results are negative. I am not sure if my
        > codes are correct.
        > >1. SOAP::Lite
        >
        >**************************************************************
        > >**** Server
        >
        >**************************************************************
        > >#!/usr/bin/perl -w
        > ># file: mysoap.cgi
        > >
        > > use DBI;
        > > use SOAP::Transport::HTTP;
        > >
        > > SOAP::Transport::HTTP::CGI
        > > -> dispatch_to('Mysoap')
        > > -> handle;
        > >
        > > package Mysoap;
        > >
        > > sub search_db
        > > {
        > > use DBI;
        > > my $db_name = "";
        > > my $passwd = "";
        > > my $login = "";
        > > $dbh =DBI->connect("DBI:mysql:$db_name",
        > $login, $passwd)
        > >
        > > $sth=$dbh->prepare(qq{select id from test
        > where id =1});
        > > $sth -> execute;
        > > my $retval = $sth->fecthrow;
        > > return $retval;
        > > }
        > >
        > >1;
        > >#end mysoap.cgi
        >
        > Are you getting any server errors?
        > I suggest putting the Mysoap package either *before*
        > the
        > call to SOAP:Transport (and then switching back to
        > the main package)
        > or into a separate file.
        >
        there's no server msg detected.
        Do you mean dynamic deployment? Does it make any
        difference?

        >
        >**************************************************************
        > >**** Client
        >
        >**************************************************************
        > >#!/usr/bin/perl -w
        > ># file: test.pl
        > >
        > >use SOAP::Lite;
        > >my $soap =SOAP::Lite
        > > ->uri("urn:Mysoap")
        > >
        >
        ->proxy("http://www.dept.university.edu/~mylogin/cgi-
        > >bin/mysoap.cgi")
        > > ->hi();
        >
        > There is no hi() method in Mysoap package.
        This is a mistake. It should be search_db() rather
        than hi(). Sorry.
        >
        > Regards,
        > Duncan Cameron
        >

        Did you test DBI within CGI or SOAP::Lite? Could you
        show me an example?
        Thanks.
        Shawn Wang

        __________________________________________________
        Yahoo! - We Remember
        9-11: A tribute to the more than 3,000 lives lost
        http://dir.remember.yahoo.com/tribute
      • Dougal Campbell
        ... ^^^^^^^^ Is this typo (should be fetchrow ) in the code you re trying to run, or was that just a transcription error when you composed the email? --
        Message 3 of 5 , Sep 10, 2002
          On Tue, 10 Sep 2002, shihewang wrote:

          > [....]
          > $sth=$dbh->prepare(qq{select id from test where id =1});
          > $sth -> execute;
          > my $retval = $sth->fecthrow;
          ^^^^^^^^

          Is this typo (should be 'fetchrow') in the code you're trying to run, or
          was that just a transcription error when you composed the email?

          --
          Ernest MacDougal Campbell III, MCP+I, MCSE <dougal@...>
          http://dougal.gunters.org/ http://spam.gunters.org/
          Web Design & Development: http://www.mentalcollective.com/
          This message is guaranteed to be 100% eror frea!
        • shihewang
          ... run, or ... You are right. It is a mistake when compose the email. The code is my $result = $sth- fetchrow; Sorry. Shawn Wang
          Message 4 of 5 , Sep 10, 2002
            --- In soaplite@y..., Dougal Campbell <dougal@g...> wrote:
            > On Tue, 10 Sep 2002, shihewang wrote:
            >
            > > [....]
            > > $sth=$dbh->prepare(qq{select id from test where id =1});
            > > $sth -> execute;
            > > my $retval = $sth->fecthrow;
            > ^^^^^^^^
            >
            > Is this typo (should be 'fetchrow') in the code you're trying to
            run, or
            > was that just a transcription error when you composed the email?
            >
            > --
            > Ernest MacDougal Campbell III, MCP+I, MCSE <dougal@g...>
            > http://dougal.gunters.org/ http://spam.gunters.org/
            > Web Design & Development: http://www.mentalcollective.com/
            > This message is guaranteed to be 100% eror frea!

            You are right. It is a mistake when compose the email. The code is
            my $result = $sth->fetchrow;
            Sorry.
            Shawn Wang
          Your message has been successfully submitted and would be delivered to recipients shortly.