Skip to search.

Breaking News Visit Yahoo! News for the latest.

×Close this window

soaplite · SOAP::Lite for Perl (soaplite.com)

The Yahoo! Groups Product Blog

Check it out!

Group Information

  • Members: 1205
  • Category: Protocols
  • Founded: Jan 28, 2001
  • Language: English
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Messages

Advanced
Messages Help
Messages 1803 - 1832 of 6629   Oldest  |  < Older  |  Newer >  |  Newest
Messages: Show Message Summaries Sort by Date ^  
#1803 From: "estancedotorg" <estancedotorg@...>
Date: Tue Sep 3, 2002 8:55 pm
Subject: Lite.dll and JavaScript
estancedotorg
Send Email Send Email
 
Hello,

I have an application where the client will (hopefully) be JavaScript
and the server is W2K running IIS and the latest perl and SOAP::Lite.

I was wondering if anyone actually got the JavaScript client example
to work, i.e.:

<script language="javascript">
<!--
// .create() here is synonim for .new(), because new()
// is reserved in JavaScript

var objPerlCOM = new ActiveXObject("SOAP.Lite");
var SOAP = objPerlCOM.create();
SOAP.proxy("http://norm/soap1/fauxex.pl")
     .uri("Fauxex");

function getStateName (form) {
   form.result.value = SOAP.getStateName(form.state.value).result();
}
//-->
</script>

I tried both the full and min. versions of Lite.dll as well as
building both myself (I have ActiveState's PDK).  Every time the page
loads, I run into the same error: "Automation server can't create
object" referring to the line: var objPerlCOM = new ActiveXObject
("SOAP.Lite");

Using Microsoft's OLE viewer, I can see SOAP_Lite_COM_TypeLib is
present and the methods seem like they ought to work.  Lastly, I
tried other OLE stuff and could successfully launch applications like
Outlook and Excel.

Any help would be great.

Brian

#1804 From: Eric Promislow <ericp@...>
Date: Wed Sep 4, 2002 5:03 pm
Subject: Re: Lite.dll and JavaScript
ericpromislow
Send Email Send Email
 
Hi, Brian, this worked:

var objPerlCOM = new ActiveXObject("PerlCOM.Script");
var sh = new ActiveXObject("WScript.Shell");
var SOAP = objPerlCOM.CreateObject("SOAP::Lite", "new");
var soap_service =
SOAP.service('http://services.xmethods.net/soap/urn:xmethods-delayed-quotes.wsdl\
');
var res = soap_service.getQuote('borl');
sh.Popup(res);

- Eric

> Message: 1
>    Date: Tue, 03 Sep 2002 20:55:54 -0000
>    From: "estancedotorg" <estancedotorg@...>
> Subject: Lite.dll and JavaScript
>
> Hello,
>
> I have an application where the client will (hopefully) be JavaScript
> and the server is W2K running IIS and the latest perl and SOAP::Lite.
>
> I was wondering if anyone actually got the JavaScript client example
> to work, i.e.:
>
> <script language="javascript">
> <!--
> // .create() here is synonim for .new(), because new()
> // is reserved in JavaScript
>
> var objPerlCOM = new ActiveXObject("SOAP.Lite");
> var SOAP = objPerlCOM.create();
> SOAP.proxy("http://norm/soap1/fauxex.pl")
>     .uri("Fauxex");
>
> function getStateName (form) {
>   form.result.value = SOAP.getStateName(form.state.value).result();
> }
> //-->
> </script>
>
> I tried both the full and min. versions of Lite.dll as well as
> building both myself (I have ActiveState's PDK).  Every time the page
> loads, I run into the same error: "Automation server can't create
> object" referring to the line: var objPerlCOM = new ActiveXObject
> ("SOAP.Lite");
>
> Using Microsoft's OLE viewer, I can see SOAP_Lite_COM_TypeLib is
> present and the methods seem like they ought to work.  Lastly, I
> tried other OLE stuff and could successfully launch applications like
> Outlook and Excel.
>
> Any help would be great.
>
> Brian

#1805 From: "gwzoller" <gwzoller@...>
Date: Thu Sep 5, 2002 6:26 pm
Subject: Java-->SOAP::Lite Serialization Question
gwzoller
Send Email Send Email
 
Hello...

I'm working to try to get SOAP::Lite clients to work
with GLUE servers.

I have a simple call to a Java server that passes a
Vector.  A Java/GLUE client sends this XML:

   <ns0:showList xmlns:ns0='http://tempuri.org/Server'
       xmlns:ns1='http://www.themindelectric.com/collections/'>
     <list id='id0' xsi:type='ns1:Vector'>
       <elements id='id1' xsi:type='soapenc:Array'
            soapenc:arrayType='xsd:anyType[3]'>
         <i xsi:type='xsd:string'>one</i>
         <i xsi:type='xsd:string'>two</i>
         <i xsi:type='xsd:string'>three</i>
       </elements>
     </list>
   </ns0:showList>

Simple enough.  But my SOAP::Lite client sends this:

    <namesp1:showList xmlns:namesp1="http://tempuri.org/Server">
     <elements SOAP-ENC:arrayType="xsd:string[4]"
        xsi:type="SOAP-ENC:Array">
         <item xsi:type="xsd:string">John</item>
         <item xsi:type="xsd:string">Ringo</item>
         <item xsi:type="xsd:string">Paul</item>
         <item xsi:type="xsd:string">George</item>
     </elements>
    </namesp1:showList>

As you can see, I'm missing the <list> tag for some
reason.  Here's my SOAP::Lite client code:

my @beatles = qw(John Ringo Paul George);
my $elements = SOAP::Data->type('Array' => [ map
{SOAP::Data->name(item => $_)->type('string')} @beatles
])->name('elements');
my $vector =
SOAP::Data->type('http://www.themindelectric.com/collections/:Vector'
=> $elements)->name('list');
$server->showList( $vector );

For some reason my attempt to make the 'list' tag never
made it to the output XML.  Here's a snippet from Server.pm
generated by stubmaker:

   showList => {
     endpoint => 'http://192.168.3.6:9004/glue/urn:test',
     soapaction => 'showList',
     uri => 'http://tempuri.org/Server',
     parameters => [
       SOAP::Data->new(name => 'list', type =>
'http://www.themindelectric.com/collections/:Vector', attr => {}),
     ],
   },

Any help would be greatly appreciated!
Greg

#1806 From: "C Aditya" <caditya@...>
Date: Fri Sep 6, 2002 9:06 am
Subject: Wanted to know more about why the write timeout error occurs
aditya_p_c
Send Email Send Email
 
Hello Everybody,
         I want to use the soap lite module with perl
5.8.0 ,and i  have built and installed the following
modules to be able to use xml and soap.
    HTML-Parser-3.26
    libwww-perl-5.65
    digest::md5
    URI-1.21
    XML-Parser-2.31
    SOAP-Lite-0.55

    I wanted to know if i have missed out any module,
or installed something that wasnt necessary. Also
when i execute the following soap client code

   use SOAP::Lite;
   my $soap = SOAP::Lite
    -> uri('http://www.soaplite.com/Temperatures')
    ->proxy('http://services.soaplite.com/temper.cgi');
   my $result = $soap->c2f(36.5);
   unless ($result->fault) {
     print $result->result();
   } else {
     print join ', ',
       $result->faultcode,
       $result->faultstring;
   }
     I get the error         500 write timeout
It would be great if anyone let me know what are the
possible reasons this error could occur, and if there
is something i missed out during installation.
     Hope to hear from you soon,
thanks,
aditya

#1807 From: "markwesterman" <mark.westerman@...>
Date: Fri Sep 6, 2002 2:23 pm
Subject: SOAP-Lite-0.55 SSL TCP Server Problems.
markwesterman
Send Email Send Email
 
When I create a SSL TCP server and client. The first
time the client run the server reports the following
errors

Use of uninitialized value in pattern match (m//) at
/usr/lib/perl5/site_perl/5.6.1/SOAP/Lite.pm line 1594.
Use of uninitialized value in pattern match (m//) at
/usr/lib/perl5/site_perl/5.6.1/SOAP/Lite.pm line 1594.
Use of uninitialized value in subroutine entry at
/usr/lib/perl5/vendor_perl/5.6.1/i386-linux/XML/Parser/Expat.pm line 474.

After that the client work fine and the server does not report
any errors. Also the errors are see when using a none SSL server.


Mark Westerman

#1808 From: Marten Lehmann <lehmann@...>
Date: Fri Sep 6, 2002 2:45 pm
Subject: SOAP-call without doing HTTP
martenlehmann
Send Email Send Email
 
Hello,

I'd like to change the following code so that SOAP::Lite generates the
xml-message, but doesn't post them. Instead I want to do the
http-connection handling and feed SOAP::Lite with the response I get.

use SOAP::Lite;
use strict;

my ($domain, $soap, $code, $msg);

$soap = SOAP::Lite
      -> uri('DomainTools')
      -> proxy('http://soap.variomedia.de/public/');

$domain = shift @ARGV;
($code, $message) = @{$soap->getDomainStatus($domain)->result};
print "$domain: [$code] [$msg]";

Wherefor I need this is as follows: I want to do several SOAP-calls at
the same time, but with SOAP::Lite I have to wait until I receive a
response for the current SOAP-call. So I want to syswrite the
xml-message on my own to the http-servers and sysread the responses as
they come - nonblocked of course. After fully retrieved the response I
again want to use SOAP::Lite to do the parsing.

Regards
Marten

#1809 From: Duncan Cameron <dcameron@...>
Date: Fri Sep 6, 2002 6:27 pm
Subject: Re: SOAP-call without doing HTTP
dcameron@...
Send Email Send Email
 
On 2002-09-06 Marten Lehmann wrote:
>Hello,
>
>I'd like to change the following code so that SOAP::Lite generates the
>xml-message, but doesn't post them. Instead I want to do the
>http-connection handling and feed SOAP::Lite with the response I get.
>
>use SOAP::Lite;
>use strict;
>
>my ($domain, $soap, $code, $msg);
>
>$soap = SOAP::Lite
>     -> uri('DomainTools')
>     -> proxy('http://soap.variomedia.de/public/');
>
>$domain = shift @ARGV;
>($code, $message) = @{$soap->getDomainStatus($domain)->result};
>print "$domain: [$code] [$msg]";
>
>Wherefor I need this is as follows: I want to do several SOAP-calls at
>the same time, but with SOAP::Lite I have to wait until I receive a
>response for the current SOAP-call. So I want to syswrite the
>xml-message on my own to the http-servers and sysread the responses as
>they come - nonblocked of course. After fully retrieved the response I
>again want to use SOAP::Lite to do the parsing.
>

Have a look at the call() method in the SOAP::Lite package.  It may
give you some ideas about how to create the SOAP envelope for
sending and how to handle the received envelope.

Regards,
Duncan Cameron

#1810 From: "shihewang" <shihewang@...>
Date: Sat Sep 7, 2002 4:48 pm
Subject: SOAP::Lite server
shihewang
Send Email Send Email
 
Hello,
I am a beginner. I need help to start a SOAP::Lite server.
I am trying SOAP:Lite server-client from Quick Start Guide with SOAP
and SOAP::Lite at Solaris. I run the client hibye.pl at my home
address, it works. Now I downdload the server, hibye.cgi to my ./cgi-
bin/, and change the client as:
#!perl -w
   use SOAP::Lite;
   print SOAP::Lite
     -> uri('http://www.dept.university.com/~mylogin/cgi-bin/Demo')
     -> proxy('http://www.dept.university.com/~mylogin/cgi-
bin/hibye.cgi')
     -> hi()
     -> result;

When I run the client, nothing displayed.
I have set both hibye.cgi and hibye.pl chmod 755. I have also
setup .htaccess in ./mylogin/public_html:
SetHandler perl-script
PerlHandler Apache::SOAP
PerlSetVar dispatch_to "/home/machine/mylogin/public_html/cgi-
bin/Demo"

Please tell me I should do let SOAP::Lite server work. Thanks.

Shawn Wang

#1811 From: Henrik Schak Hansen <hsh@...>
Date: Mon Sep 9, 2002 9:36 am
Subject: SoapLite dll minimal or standalone dosn't work
schakhenrik
Send Email Send Email
 
I am trying to get the VB Soap examples
to work, but they all fail.

I have the latest ActiveState Perl installed
on my computer and SoapLite 0.55.

When I register the standalone DLL(successfully) and try
to use the provided VB soap examples it says:

Run-Time error....
Automation error
Unspecified error

When I try to use the small version dll it says:

"Can't find PerlCtrl"

Looking trough the archive others have had similar
problems but I can't see any solutions (other than running
it on a computer where Perl isn't installed).


Any suggestions ?


Regards
Henrik Schak

-------
[Denne E-mail blev scannet for virus af Declude Virus]
[This E-mail was scanned for viruses by Declude Virus]

#1812 From: "shihewang" <shihewang@...>
Date: Tue Sep 10, 2002 2:45 am
Subject: Do SOAP::Lit and CGI support database-MySQL?
shihewang
Send Email Send Email
 
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

**************************************************************
****  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();
print $soap->result;
print "see  result from database?\n";

Error msg is:
Use of uninitialized value in concatenation (.) or string at test1.pl
line 9.


2 CGI
**************************************************************
****  cgi
**************************************************************
#!/usr/bin/perl -w
# file: test1.pl

use CGI;
use DBI;

  my $test = CGI -> new();

  print $test -> header();
  print $test -> start_html
  ( -title => 'Test Database',
   -target => '_new',
   -BGCOLOR => 'dddddd');

  print "Wait, I am fecthing data from db ...<br>";

  my $db_name = <STDIN>;
  my $passwd = <STDIN>;
  my $login = <STDIN>;

  $dbh =DBI->connect("DBI:mysql:$db_name", $login, $passwd);
  $sth=$dbh->prepare(qq{select id from test where id=1});
  $sth -> execute;
  my $result = $sth->fetchrow;
  print $result;
   print $test -> end_html();

#end test1.pl

When ran on command line, there's "1", but when use browser point to
test1.pl, there's no "1".

#1813 From: Duncan Cameron <dcameron@...>
Date: Tue Sep 10, 2002 4:54 am
Subject: Re: Do SOAP::Lit and CGI support database-MySQL?
dcameron@...
Send Email Send Email
 
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

#1814 From: Shihe Wang <shihewang@...>
Date: Tue Sep 10, 2002 11:59 am
Subject: Re: Do SOAP::Lit and CGI support database-MySQL?
shihewang
Send Email Send Email
 
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

#1815 From: Dougal Campbell <dougal@...>
Date: Tue Sep 10, 2002 1:29 pm
Subject: Re: Do SOAP::Lit and CGI support database-MySQL?
dougal@...
Send Email Send Email
 
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!

#1816 From: "shihewang" <shihewang@...>
Date: Tue Sep 10, 2002 2:13 pm
Subject: Re: Do SOAP::Lit and CGI support database-MySQL?
shihewang
Send Email Send Email
 
--- 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

#1817 From: "Chris" <chris@...>
Date: Tue Sep 10, 2002 3:56 pm
Subject: Exception::Class and SOAP::Lite
marceusx
Send Email Send Email
 
Hi,

I'm having a strange issue when I try to use Exception::Class and
SOAP::Lite 0.55 under mod_perl.

I'm trying to add some easier error handling code to my Soap application
and would like to use the same semantics in the SOAP pacakges as I do in
the rest of the code.

I have created a class My::Exceptions that uses Exception::Class to create
some Exception Objects. I have created a new base Exceptions object
My::Exceptions::Base that overloads some of the methods in
Exceptions::Class. This works beautifully from the command line.

I have created a package My::SOAP::Exceptions that re-defines the Handler
for My::Error and My::Fault to throw SOAP::Fault objects instead of
printing to STDERR.

My problem comes in when calling using the SOAP package. If I throw an
error in a SOAP method the Error object is re-defined. It is no-longer a
hash based object but instead what appears to be a scalar based object. It
appears that something is re-blessing my object after I capture it, which
leads me to believe the problems lies with SOAP::Lite instead of simply
mod_perl.

To add to the complexity, if I use Exceptions::Class directly, and include
all the method overloading into the SOAP class that's throwing the error
everything works fine.

If it helps I've included versions of the scripts below. I'm clueless as to
what's going on here.

-Chris

--------- Begin Scripts ---------

package My::Exceptions;
$VERSION = 0.01;
use strict;

sub BEGIN {
   no strict;

     sub My::Exceptions::Base::full_message { return $_[0]->description; }
     sub My::Exceptions::Base::handler {
       print join " ", ("Untyped Exception Caught", $_[0]->as_string)
     }
     sub My::Exceptions::Base::details { return $_[0]->message; }
     sub My::Error::handler {
         print "Caught Error: ", '(', $_[0]->details, ')', "\n";
         print $_[0], ;
     }
     sub My::Fault::handler {
         print "Caught Fault:\n";
         print $_[0]->details, "\n";
         print $_[0]->trace()->as_string;
     }

     require Exception::Class;
     Exception::Class->import(
         'Soq::Exceptions::Base'=>{
            description => 'An Utyped Exception Has Occured'
         },
         'Soq::Error'=>{
            description => 'An Unexpected Error Has Occured',
            isa=>'Soq::Exceptions::Base'
         },
         'Soq::Fault'=>{
            description => 'An Unexpected Fault Has Occured',
            isa=>'Soq::Exceptions::Base'},
         'STUPID_USER'=>{
            description=>'Never do that again.'}
     );
}

--------Test Script------------

package Soq::Test::Exception_Stuff;
use strict;
use lib 'c:\my\server';
use My::Exceptions;

eval {throw STUPID_USER("file does not exist");};
if ($@) {
     $@= new Soq::Fault($@) unless ref $@;
     $@->handler();
};

---------SOAP Exceptions Package----------

package My::SOAP::Exceptions;
$VERSION = 0.01;
use strict;
use My::Exceptions;
use SOAP::Lite;

sub BEGIN {
   no warnings;
   *My::Error::handler = \&generateSoapError;
   *My::Fault::handler = \&generateSoapFault;
}

sub generateSoapError {
   my ($error) = @_;
   use Data::Dumper;
   die SOAP::Fault->faultcode("SoqError:".ref $error)
                  ->faultstring($error->as_string)
                  ->faultdetail($error->details)
                  ->faultactor('http://www.soaplite.com/custom');
}

sub generateSoapFault {
   my ($error) = @_;
   die SOAP::Fault->faultcode("SoqFault:".ref $error)
                  ->faultstring($error->as_string)
                  ->faultdetail($error->details)
                  ->faultactor('http://www.soaplite.com/custom');
}


----------Simple SOAP Method--------------

package Soq::SOAP::Test_Exceptions;
$VERSION = 0.01;
use strict;
use My::SOAP::Exceptions;

sub throw_error {
   my $e = STUPID_USER->new();
   die $e->as_string;
}


package Soq::SOAP::Test_Exceptions2;
$VERSION = 0.01;
use strict;

sub BEGIN {
     sub Test::Base::as_string { return "Test 1,2,3";  }
     sub TEST_ERROR::as_string { return "Test A,B,C";  }
}

use Exception::Class(
   'Test::Base',
   'TEST_ERROR'=>{isa=>'Test::Base'},
   'STUPID_USER'=>{isa=>'TEST_ERROR'}
);

sub throw_error {
   my $e = STUPID_USER->new();
   die $e->as_string;
}

#1818 From: Eric Promislow <ericp@...>
Date: Tue Sep 10, 2002 5:30 pm
Subject: Re: SoapLite dll minimal or standalone dosn't work
ericpromislow
Send Email Send Email
 
Hello, Henrik,

I'm not sure which DLLs you're referring to.  I went to
my local SOAP-Lite-0.52\examples\COM, didn't find any DLLs,
built a minimal DLL by running

perlctrl Lite.ctrl

registered it, and was able to run service.vbs

You do need the ActiveState Perl Dev Kit to build the DLL.

- Eric

>    Date: Mon, 9 Sep 2002 11:36:55 +0200
>    From: Henrik Schak Hansen <hsh@...>
> Subject: SoapLite dll minimal or standalone dosn't work
>
>
> I am trying to get the VB Soap examples
> to work, but they all fail.
>
> I have the latest ActiveState Perl installed
> on my computer and SoapLite 0.55.
>
> When I register the standalone DLL(successfully) and try
> to use the provided VB soap examples it says:
>
> Run-Time error....
> Automation error
> Unspecified error
>
> When I try to use the small version dll it says:
>
> "Can't find PerlCtrl"
>
> Looking trough the archive others have had similar
> problems but I can't see any solutions (other than running
> it on a computer where Perl isn't installed).
>
>
> Any suggestions ?
>
>
> Regards
> Henrik Schak

#1819 From: "jpeyser" <jpeyser@...>
Date: Tue Sep 10, 2002 6:44 pm
Subject: Re: SOAP-call without doing HTTP
jpeyser
Send Email Send Email
 
Marten,
     The following program solves the first part of your dilemma. This
will create the XML code for each request without sending out
anything.

     Jonathan

#!/usr/local/bin/perl -w

# -- SOAP::Lite -- guide.soaplite.com -- Copyright (C) 2001 Paul
Kulchenko --
# My packages by J. Peyser

use SOAP::Lite;
use SOAP::Transport::HTTP;


sub BEGIN {
package My::Transport;

@ISA = qw(SOAP::Transport);

### Sub proxy redefined to eliminate lines searching for transport
module.
sub proxy {
	 my $self = shift->new;
	 my $class = ref $self;

	 return $self->{_proxy} unless @_;
	 $_[0] =~ /^(\w+):/ or die "proxy: transport protocol not
specified\n";
	 my $protocol = uc "$1"; # untainted now
	 # https: should be done through Transport::HTTP.pm
	 for ($protocol) { s/^HTTPS$/HTTP/ }

	 (my $protocol_class = "${class}::$protocol") =~ s/-/_/g;
	 no strict 'refs';
	 unless (defined %{"$protocol_class\::Client::"} &&
UNIVERSAL::can("$protocol_class\::Client" => 'new')) {
#  eval "require $protocol_class";
#  die "Unsupported protocol '$protocol'\n" if $@ =~ m!
^Can't locate SOAP/Transport/!;
#  die if $@;
   }
   $protocol_class .= "::Client";
   return $self->{_proxy} = $protocol_class->new(endpoint => shift,
@_);
}


package My::Transport::HTTP::Client;

@ISA = qw(SOAP::Transport::HTTP::Client);
@xml = ();

### Sub send_receive redefined to bypass HTTP or any other transport
protocol.
sub send_receive {
	 my($self, %parameters) = @_;
	 my($envelope, $endpoint, $action, $encoding) =
		 @parameters{qw(envelope endpoint action encoding)};

	 push @xml, $envelope;
	 $self->is_success(1);

	 return;
}

} #End BEGIN


die "Usage: $0 <symbol>...\n" unless $#ARGV > -1;

my ($domain, $soap, $code, $msg, $message);

$soap = SOAP::Lite
	 -> uri('DomainTools')
	 -> transport(My::Transport->new)
	 -> proxy('http://soap.variomedia.de/public/');

while ($domain = shift) {

	 $soap->getDomainStatus($domain);
# ($code, $message) = @{$soap->getDomainStatus($domain)-
>result};
#    print "$domain: [$code] [$msg]";

}

foreach (@My::Transport::HTTP::Client::xml) {print $_, "\n";};


--- In soaplite@y..., Marten Lehmann <lehmann@c...> wrote:
> Hello,
>
> I'd like to change the following code so that SOAP::Lite generates
the
> xml-message, but doesn't post them. Instead I want to do the
> http-connection handling and feed SOAP::Lite with the response I
get.
>
> use SOAP::Lite;
> use strict;
>
> my ($domain, $soap, $code, $msg);
>
> $soap = SOAP::Lite
>      -> uri('DomainTools')
>      -> proxy('http://soap.variomedia.de/public/');
>
> $domain = shift @ARGV;
> ($code, $message) = @{$soap->getDomainStatus($domain)->result};
> print "$domain: [$code] [$msg]";
>
> Wherefor I need this is as follows: I want to do several SOAP-calls
at
> the same time, but with SOAP::Lite I have to wait until I receive a
> response for the current SOAP-call. So I want to syswrite the
> xml-message on my own to the http-servers and sysread the responses
as
> they come - nonblocked of course. After fully retrieved the
response I
> again want to use SOAP::Lite to do the parsing.
>
> Regards
> Marten

#1820 From: "Bouche" <bouche@...>
Date: Wed Sep 11, 2002 10:53 am
Subject: Strange behavior in SOAP
swoxholt
Send Email Send Email
 
Hi,
 
I'm experiencing some strange things in SOAP which i have trouble fixing.
 
The response i get from the soap-server looks good....and there is some info i need to extract *look below, a cutout of the response*
One should belive that when it would be possible to access these elements (resultCauseText & resultCauseCode ), but when i try i only get the
last element (<resultCauseText xsi:type="xsd:string">Tilgjengelig produktklasse: ADSL 2048/256</resultCauseText>).
 
I found this pretty strange, and ran a Dumper on the respons-hash, and saw this :
 
'listOfResultCause' => bless( {
    'item' => bless( {
        'resultCauseText' => 'Tilgjengelig produktklasse: ADSL 2048/256',
        'resultCauseCode' => '180'
    }, 'ResultCause' )
}, 'Vector' )
 
 
And this is where it all stops because to me it seemes that the other elements in this Vector is overwriten or something,
anyone got a clue on what is going on here??
 
 
 
***** response ******
 
<listOfResultCause xsi:type="ns3:Vector">
<item xmlns:ns9="urn:soap-kapaks-response-ResultCause-kapaksm2minterface" xsi:type="ns9:ResultCause">
<resultCauseText xsi:type="xsd:string">Linjen har produktet ISDN GT</resultCauseText>
<resultCauseCode xsi:type="xsd:int">30</resultCauseCode>
</item>
<item xmlns:ns10="urn:soap-kapaks-response-ResultCause-kapaksm2minterface" xsi:type="ns10:ResultCause">
<resultCauseText xsi:type="xsd:string">Total linjelengde inkludert inntak: 496 meter</resultCauseText>
<resultCauseCode xsi:type="xsd:int">110</resultCauseCode>
</item>
<item xmlns:ns11="urn:soap-kapaks-response-ResultCause-kapaksm2minterface" xsi:type="ns11:ResultCause">
<resultCauseText xsi:type="xsd:string">Lengde på inntak: 100 meter (standard)</resultCauseText>
<resultCauseCode xsi:type="xsd:int">111</resultCauseCode>
</item>
<item xmlns:ns12="urn:soap-kapaks-response-ResultCause-kapaksm2minterface" xsi:type="ns12:ResultCause">
<resultCauseText xsi:type="xsd:string">Linjestatus: Ukjent</resultCauseText>
<resultCauseCode xsi:type="xsd:int">122</resultCauseCode>
</item>
<item xmlns:ns13="urn:soap-kapaks-response-ResultCause-kapaksm2minterface" xsi:type="ns13:ResultCause">
<resultCauseText xsi:type="xsd:string">Fabrikat på utstyr: ALCASH</resultCauseText>
<resultCauseCode xsi:type="xsd:int">150</resultCauseCode>
</item>
<item xmlns:ns14="urn:soap-kapaks-response-ResultCause-kapaksm2minterface" xsi:type="ns14:ResultCause">
<resultCauseText xsi:type="xsd:string">Tilgjengelig produktklasse: ADSL 2048/256</resultCauseText>
<resultCauseCode xsi:type="xsd:int">180</resultCauseCode>
</item>
</listOfResultCause>
 
 
--
Med vennlig hilsen / Kind regards
Stig Woxholt - Senior Programmer
Tiscali Norway AS
P.O. Box 598, Skøyen - N-0214 Oslo
Tel + 47 24 11 24 00 - Fax + 47 24 11 24 11
Dir + 47 24 11 28 25 - Mob + 47 99 21 76 45
 

#1821 From: "yshigemo" <yshigemo@...>
Date: Wed Sep 11, 2002 11:55 am
Subject: How to set infinite timeout and deal with large object
yshigemo
Send Email Send Email
 
Hi,

I'd like to access long job with SOAP-Lite.
I can set the timeout value if I see the time of
execution time. But there are a lot of cases
I don't see it.

Can I set the timeout infinite?

I have another question.
I'd like to get the large result with SOAP-Lite.
For example the size of result is 20MB.

In java language environment, SOAP attachment and
InputStream technology is useful in this case.

Do you have any idea in perl language and SOAP-Lite
environment?

Yasumasa Shigemoto

#1822 From: "Chad Simmons" <polpak@...>
Date: Wed Sep 11, 2002 5:11 pm
Subject: First foray into SOAP and SOAP::Lite
polpak
Send Email Send Email
 
Greetings,

I've just recently joined this group and try though I might, I've
been unable to locate a FAQ on for it. I hope that you will,
therefore, forgive any faux pas on my part.

In any event, I've recently had a situation come up in which I need
to develop a soap client. I did a bit of research on SOAP and
SOAP::Lite, and read some examples.. However, one thing still puzzles
me. I've been given documentation for the SOAP API I'll be
communicating with, but it only really explains how the header,
envelope and body are supposed to be formatted. Now it's my
understanding that most of this will be handled by the SOAP::Lite
library, so I don't really need (or want) to understand these
specifics. However, I cannot easily determine how I can convert the
information layed out in the example request and response SOAP
messages into SOAP::Lite calls and SOAP::DATA objects..

If anyone couls shed some "lite" (pun obviously intended) on this
subject I would greatly appreciate it.

Thank you for your time,
Chad Simmons

#1823 From: "Simon West" <simon.west@...>
Date: Thu Sep 12, 2002 2:08 pm
Subject: Getting HTTP Headers
swests
Send Email Send Email
 
Hi all

Firstly i'm pretty new to Perl so please bear with me :-)

The WebService i'm talking to send an ID as part of the HTTP
headers.  How do I get this id and then resend it on further requests?

The code is below (as I said I'm still new to perl...)  The service
is an ASP.NET address book sample.  How would I extend this to read a
HTTP header when a SOAP reply is returned??????


Thanks in advance....

Simon



use SOAP::Lite;

$SERVICE
= 'http://MSSoapSampleServer:8080/MSSoapSamples/AddrBook/Service/Rpc/I
sapiVb/AddrBook.WSDL';

sub dumpHash {
	 local($x) = @_;
	 foreach $i (sort keys %$x) {
		 printf "$i : $$x{$i} \n";
	 }
}

sub dumpArray {
	 local($x) = @_;
	 $i = 0;
	 foreach (@$x) { # Access the entire array.
		 printf "$$x[$i++]\n";
	 }
}

sub prompt {
	 local($text) = @_;
	 print "\n$text : ";
	 $reply = <STDIN>;
	 chop $reply;
	 return $reply;
}


sub connectSoap {
	 my $soapObject = SOAP::Lite
		 -> service($SERVICE);
	 return $soapObject;
}


sub getNames {
	 local($soap) = shift;
	 my $soap_response = $soap
		 -> GetNames();
	 return $soap_response;
}

sub getAddr {
	 local ($soap) = shift;
	 local ($name) = shift;
	 my $soap_response = $soap
		 -> GetAddr("$name");
	 return $soap_response;
}

sub printAddr{
	 local ($addr) = shift;
	 print "\nName   : $$addr{name}";
	 print "\nStreet : $$addr{street}";
	 print "\nCity   : $$addr{city}";
	 print "\nState  : $$addr{state}";
	 print "\nZip    : $$addr{'zip-code'}";

	 $i = 0;
	 $x = $$addr{'phone-numbers'};

	 foreach (@$x) { # Access the entire array.
		 if ($i == 0) {
			 print "\nPhone# : ";
		 }
		 else {
			 print "       : ";
		 }
		 printf "$$x[$i++]\n";
	 }
}

$connection = connectSoap();
#$names = getNames($connection);
#dumpArray($names);
#$choice = prompt("Select a name");
#$addr = getAddr($connection, $choice);
$addr = getAddr($connection, "Kim");
printAddr($addr);

#1824 From: "Chad Simmons" <polpak@...>
Date: Thu Sep 12, 2002 8:46 pm
Subject: more questions
polpak
Send Email Send Email
 
Ok, I've managed to write a few client scripts with SOAP::Lite for
various services described at services.xmethods.net . However, I'm
still having some difficulty reading the service specs and converting
them into working SOAP::Lite calls. Most of the services I have
problems figuring out are the ones listed as being of type DOC
instead of RPC.. I'm not entirely sure what that means.. but is there
some other way I need to be building the SOAP::Lite object or
function perameters?? As an example I'm looking at the 'Periodic
Table' service at

http://services.xmethods.net/ve2/ViewListing.po;jsessionid=kYUe8QMoRIS
3bfEbQHr6DBRS(QhxieSRM)?serviceid=119931

And when I make a call to GetAtoms I'm getting back one large xml
type document rather than an array of hash references (which is what
I would expect..) Am I just expecting too much? Anyone care to
enlighten me?

Thanks again,
Chad Simmons

#1825 From: rjray@...
Date: Fri Sep 13, 2002 8:40 am
Subject: Re: Getting HTTP Headers
rjray_perl
Send Email Send Email
 
The SOAP::Lite client object abstracts most of the communication layer away
for you, so to get the info you want you would have to subclass one of the
relevant classes that the client objects use.

Actually, I'm not sure it can be done at this point, with SOAP::Lite 0.55.
There is no hook for when the client object gets the response back from the
LWP::UserAgent side of the object. And sub-classing at the transport level
isn't really an option, since SOAP::Lite chooses that behind the scenes based
on the URI you give for an endpoint.

Paul?

Randy
--
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Randy J. Ray                                                rjray@...
Campbell, CA                                                     rjray@...
<A HREF="http://www.svsm.org">Silicon Valley Scale Modelers</A>

#1826 From: rjray@...
Date: Fri Sep 13, 2002 8:59 am
Subject: Re: Strange behavior in SOAP
rjray_perl
Send Email Send Email
 
Can you show us the code you were running? Some of the data-retrieval calls
behave differently in scalar vs. list context.

Randy
--
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Randy J. Ray                                                rjray@...
Campbell, CA                                                     rjray@...
<A HREF="http://www.svsm.org">Silicon Valley Scale Modelers</A>

#1827 From: "Torsten Mangner" <tmangner@...>
Date: Fri Sep 13, 2002 10:02 am
Subject: XML-Schema Types of complex ArrayOfHashes
tmangner
Send Email Send Email
 
Hi,

i have implemented some web services and now i wan to write a wsdl-
file to describe the interface and implementation details.

this isn't as hard as i guessed, and i made it, with one exception:
the <types>!

Since i am sending pretty complex array-of-hashes constructs as
parameters for some functions, i do not know how to represent this
complexity as a XML-Schema-Type.

This is a sample array-of-hashes, may any one of you will show me how
represent this as a xml-schema-type (with correct encoding and so):

my %hash = ('productname' => 'Toaster',
____________'manufacturer' => 'Toast Inc.',
____________'catalogs' => ['1234', '0815', '4321'],
____________'variations' => [{'color' => 'chrome',
______________________________'price' => '24.95'},
_____________________________{'color' => 'blue',
______________________________'price'=> '21.95'}]);
my @array = (\%hash, \%hash, \%hash);


I know this is a little bit off-topic, but i do not know where to ask
about this and i hope some one of you will help me.

Thanks in Advance,
Torsten

#1828 From: "Simon West" <simon.west@...>
Date: Fri Sep 13, 2002 1:42 pm
Subject: Re: Getting HTTP Headers
swests
Send Email Send Email
 
Hi again

I have received a way of reading something from the HTTP headers
(thanks Jonathan!), using the on_debug event as follows...

VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV

sub BEGIN {
package My::Trace;

sub defaultlog {
   my $caller = (caller(1))[3];
   $caller = (caller(2))[3] if $caller =~ /eval/;
   chomp(my $msg = join ' ', @_);
   ###------------------------
   my @msg = split /\n/, $msg;
   foreach (@msg) {
	   chomp;
	   if (/Client-Peer/) {
		   print "|$_|\n";
		   $My::Trace::HdrLine = $_;
	   }
   }
   ###------------------------
   #Comment out following line to supress trace/debug.
   printf STDERR "%s: %s\n", $caller, $msg;
}
}

Sub defaultlog (taken from SOAP::Trace) has been modified to search
for a line that contains 'Client-Peer' (or for whatever you are
looking in the Header). The line will be loaded into variable
$My::Trace::HdrLine, which you can parse to get the value.

The SOAP::Lite object must use this class.

	 my $soapObject = SOAP::Lite
	 -> service($SERVICE)
	 -> on_debug(sub { &My::Trace::defaultlog; } );

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

My next question (as is always the case), is how to set one.  I'm
getting the impression that SOAP::Lite might not be the way to go for
this :-(  Pity as it's fantastic for regular SOAP stuff...

Simon



--- In soaplite@y..., "Simon West" <simon.west@p...> wrote:
> Hi all
>
> Firstly i'm pretty new to Perl so please bear with me :-)
>
> The WebService i'm talking to send an ID as part of the HTTP
> headers.  How do I get this id and then resend it on further
requests?
>
> The code is below (as I said I'm still new to perl...)  The service
> is an ASP.NET address book sample.  How would I extend this to read
a
> HTTP header when a SOAP reply is returned??????
>
>
> Thanks in advance....
>
> Simon
>
>
>
> use SOAP::Lite;
>
> $SERVICE
>
= 'http://MSSoapSampleServer:8080/MSSoapSamples/AddrBook/Service/Rpc/I
> sapiVb/AddrBook.WSDL';
>
> sub dumpHash {
>  local($x) = @_;
>  foreach $i (sort keys %$x) {
> 	 printf "$i : $$x{$i} \n";
>  }
> }
>
> sub dumpArray {
>  local($x) = @_;
>  $i = 0;
>  foreach (@$x) { # Access the entire array.
> 	 printf "$$x[$i++]\n";
>  }
> }
>
> sub prompt {
>  local($text) = @_;
>  print "\n$text : ";
>  $reply = <STDIN>;
>  chop $reply;
>  return $reply;
> }
>
>
> sub connectSoap {
>  my $soapObject = SOAP::Lite
> 	 -> service($SERVICE);
>  return $soapObject;
> }
>
>
> sub getNames {
>  local($soap) = shift;
>  my $soap_response = $soap
> 	 -> GetNames();
>  return $soap_response;
> }
>
> sub getAddr {
>  local ($soap) = shift;
>  local ($name) = shift;
>  my $soap_response = $soap
> 	 -> GetAddr("$name");
>  return $soap_response;
> }
>
> sub printAddr{
>  local ($addr) = shift;
>  print "\nName   : $$addr{name}";
>  print "\nStreet : $$addr{street}";
>  print "\nCity   : $$addr{city}";
>  print "\nState  : $$addr{state}";
>  print "\nZip    : $$addr{'zip-code'}";
>
>  $i = 0;
>  $x = $$addr{'phone-numbers'};
>
>  foreach (@$x) { # Access the entire array.
> 	 if ($i == 0) {
> 		 print "\nPhone# : ";
> 	 }
> 	 else {
> 		 print "       : ";
> 	 }
> 	 printf "$$x[$i++]\n";
>  }
> }
>
> $connection = connectSoap();
> #$names = getNames($connection);
> #dumpArray($names);
> #$choice = prompt("Select a name");
> #$addr = getAddr($connection, $choice);
> $addr = getAddr($connection, "Kim");
> printAddr($addr);

#1829 From: "jpeyser" <jpeyser@...>
Date: Fri Sep 13, 2002 3:04 pm
Subject: Re: Getting HTTP Headers
jpeyser
Send Email Send Email
 
Actually, sub-classing the transport level is possible and it will
give us a hook to the LWP::UserAgent (I should have tried this
yesterday).

sub BEGIN {
use SOAP::Lite;
use SOAP::Transport::HTTP;

package My::Transport;

@ISA = qw(SOAP::Transport);

package My::Transport::HTTP::Client;

@ISA = qw(SOAP::Transport::HTTP::Client);

sub send_receive {

    ### Copy code from Transport/HTTP.pm, replacing $resp
    ### with $My::Transport::HTTP::Client::resp.

}

} #end BEGIN


my $soapObject = SOAP::Lite
-> service($SERVICE)
-> transport(My::Transport->new);

### Now we have access to the HTTP headers
print $My::Transport::HTTP::Client::resp->content_type, "\n";

Jonathan

--- In soaplite@y..., rjray@b... wrote:
> The SOAP::Lite client object abstracts most of the communication
layer away
> for you, so to get the info you want you would have to subclass one
of the
> relevant classes that the client objects use.
>
> Actually, I'm not sure it can be done at this point, with
SOAP::Lite 0.55.
> There is no hook for when the client object gets the response back
from the
> LWP::UserAgent side of the object. And sub-classing at the
transport level
> isn't really an option, since SOAP::Lite chooses that behind the
scenes based
> on the URI you give for an endpoint.
>
> Paul?
>
> Randy
> --
> """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"""""""""""
> Randy J. Ray
rjray@b...
> Campbell, CA
rjray@s...
> <A HREF="http://www.svsm.org">Silicon Valley Scale Modelers</A>

#1830 From: Paul Kulchenko <paulclinger@...>
Date: Fri Sep 13, 2002 4:14 pm
Subject: Re: Re: Getting HTTP Headers
paulclinger
Send Email Send Email
 
Hi Simon,

--- Simon West <simon.west@...> wrote:
> I have received a way of reading something from the HTTP headers
> (thanks Jonathan!), using the on_debug event as follows...
As always, there is little bit easier way (idea grabbed from examples
in cookbook: http://cookbook.soaplite.com/):

use SOAP::Lite +trace =>
   [transport => sub {
     our $header;
     $header = $_[0]->header('Client-Peer') if
$_[0]->isa('HTTP::Response');
     $_[0]->header('Client-Peer', $header) if $header &&
$_[0]->isa('HTTP::Request');
   }]
;

> My next question (as is always the case), is how to set one.  I'm
> getting the impression that SOAP::Lite might not be the way to go
> for
> this :-(  Pity as it's fantastic for regular SOAP stuff...
This code will work for both, getting and setting headers. Let me
know if that's not what you want ;)

Best wishes, Paul.


__________________________________________________
Do you Yahoo!?
Yahoo! News - Today's headlines
http://news.yahoo.com

#1831 From: rjray@...
Date: Sat Sep 14, 2002 6:11 am
Subject: Re: Re: Getting HTTP Headers
rjray_perl
Send Email Send Email
 
Actually, I had forgotten to look at the on_debug angle. That's probably the
easiest way, certainly easier than creating two different sub-classes (though
that one is more extensible). It is harder to get ones hands into the client
side of things than on the server side. I have examples in the book that show
sub-classing the server classes to get access to the HTTP headers, but nothing
like that for the clients.

Randy
--
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Randy J. Ray                                                rjray@...
Campbell, CA                                                     rjray@...
<A HREF="http://www.svsm.org">Silicon Valley Scale Modelers</A>

#1832 From: "shihewang" <shihewang@...>
Date: Sun Sep 15, 2002 6:23 pm
Subject: does soaplite support dbi-mysql?
shihewang
Send Email Send Email
 
Hello,
This is second time post the question- Does SOAP::Lie support
DBI::mysql? I really care it. If anybody has the answer, please let
me know.
I created a server-client, mysoap.cgi-test1.pl, does not work, while
the other pair, hibye.cgi-hello.pl, in the same dir on the same
machine works. And I copied the sub, search_db, from mysoap.cgi
package, and put into test2.pl. test2.pl also works. See the codes
and running result:

mysoap.cgi 		             hibye.cgi
*****************************************
*****************************************
#!/usr/bin/perl -w 		     #!/usr/bin/perl -w

#  use DBI;#tried this line                   use
SOAP::Transport::HTTP;
   use SOAP::Transport::HTTP;

SOAP::Transport::HTTP::CGI
   SOAP::Transport::HTTP::CGI                     -> dispatch_to
('Demo')
       -> dispatch_to('Mysoap')                   -> handle;
       -> handle;

   package Mysoap;                               package Demo;

   sub search_db{                                 sub hi {
   use DBI;                                       return "hello,
world";
   my $db_name = "mydb";                 }
   my $passwd = "mypasswd";
   my $login = "mylogin";                          sub bye {
   my $dbh =DBI->connect(                         return "goodbye,
cruel world";
    "DBI:mysql:$db_name", $login, $passwd);       }

   $sth=$dbh->prepare(                            1;
    qq{select id from test where id =1});
   $sth -> execute;
   my $retval = $sth->fetchrow;
   return $retval;
   }
1;
*****************************************
*****************************************


test1.pl 		              hello.pl
*****************************************
*****************************************
#!/usr/bin/perl -w                           #!/usr/bin/perl -w

  use SOAP::Lite;                               use SOAP::Lite;
  my $soap=SOAP::Lite                           my $soap= SOAP::Lite
      ->uri('urn:Mysoap')                           -> uri('urn:Demo')
      ->proxy(                                      ->proxy
('http://www.dept.univ.edu/'.
   'http://www.dept.univ.edu/'.'                       '~mylogin/cgi-
bin/hibye.cgi')
   ~mylogin/cgi-bin/mysoap.cgi')
      ->search_db();                                 -> hi();
  my $result=$soap->result;                      my $result=$soap-
>result."\n";
  print "result: $result\n";                     print "Result:
$result";
*****************************************
*****************************************



Running result: 		             Running result:
*****************************************
*****************************************
%perl test1.pl                               %perl hello.pl
Use of uninitialized value in                Result: hello, world
concatenation(.) or string at test1.pl       %
line 9.
result:
%
*****************************************
*****************************************



Test2.pl
*****************************************
#!/usr/bin/perl -w

sub search_db{
use DBI;
my $db_name = "mydb";
my $passwd = "mypasswd";
my $login = "mylogin";
my $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->fetchrow;
return $retval;
}

$result = search_db();
print "result: $result\n";
*****************************************


Running result:
*****************************************
%perl test2.pl
result: 1
%
*****************************************

Messages 1803 - 1832 of 6629   Oldest  |  < Older  |  Newer >  |  Newest
Add to My Yahoo!      XML What's This?

Copyright © 2010 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines NEW - Help