serv.pl
#!/usr/bin/perl --
use strict;
use warnings;
use SOAP::Transport::HTTP;
my $daemon = SOAP::Transport::HTTP::Daemon->new(
LocalAddr => '127.0.0.1',
LocalPort => 1203,
Reuse => 1
)->dispatch_to('Demo');
print "Contact to SOAP server at ", $daemon->url, "\n";
$daemon->handle;
#~ SOAP::Transport::HTTP::CGI
#~ -> dispatch_to('Demo')
#~ -> handle;
package Demo;
sub hi {
return "Hello, world";
}
####
clie.pl
#!/usr/bin/perl --
use strict;
use warnings;
#!perl -w
use SOAP::Lite +trace => 'all';
print SOAP::Lite
#~ -> uri('http://146.225.100.232/Demo')
#~ -> proxy('http://146.225.100.232:81/soap_server.pl')
-> uri('http://127.0.0.1/Demo')
-> proxy('http://127.0.0.1:1203')
-> on_debug( sub {print @_})
-> hi()
-> result;
####
SOAP::Transport::new: ()
SOAP::Serializer::new: ()
SOAP::Deserializer::new: ()
SOAP::Parser::new: ()
SOAP::Lite::new: ()
SOAP::Transport::HTTP::Client::new: ()
SOAP::Lite::call: ()
SOAP::Serializer::envelope: ()
SOAP::Serializer::envelope: on_debug CODE(0x97a18c)
SOAP::Data::new: ()
SOAP::Data::new: ()
SOAP::Data::new: ()
SOAP::Data::new: ()
SOAP::Data::new: ()
SOAP::Transport::HTTP::Client::send_receive: HTTP::Request=HASH(0xe76ee4)
SOAP::Transport::HTTP::Client::send_receive: POST http://127.0.0.1:1203 HTTP/1.1
Accept: text/xml
Accept: multipart/*
Accept: application/soap
Content-Length: 409
Content-Type: text/xml; charset=utf-8
SOAPAction: "http://127.0.0.1/Demo#on_debug"
SOAP::Transport::HTTP::Client::send_receive: HTTP::Response=HASH(0x10b2a34)
SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 500 Internal Server Error
Date: Wed, 09 Dec 2009 22:09:39 GMT
Server: libwww-perl-daemon/5.827
Content-Length: 737
Content-Type: text/xml; charset=utf-8
Client-Date: Wed, 09 Dec 2009 22:09:39 GMT
Client-Peer: 127.0.0.1:1203
Client-Response-Num: 1
SOAPServer: SOAP::Lite/Perl/0.710.10
soap:ClientFailed to access class (Demo): Can't locate Demo.pm in @INC (@INC contains: C:/perl/5.10.1/lib/MSWin32-x86-multi-thread C:/perl/5.10.1/lib C:/perl/site/5.10.1/lib/MSWin32-x86-multi-thread C:/perl/site/5.10.1/lib .) at (eval 110) line 3.
http://localhost:1203/
SOAP::Deserializer::deserialize: ()
SOAP::Parser::decode: ()
SOAP::SOM::new: ()
Can't locate object method "hi" via package "SOAP::SOM" at clie.pl line 20.
SOAP::SOM::DESTROY: ()
SOAP::Lite::DESTROY: ()
SOAP::Transport::DESTROY: ()
SOAP::Transport::HTTP::Client::DESTROY: ()
SOAP::Deserializer::DESTROY: ()
SOAP::Parser::DESTROY: ()
SOAP::Serializer::DESTROY: ()
SOAP::Data::DESTROY: ()
SOAP::Data::DESTROY: ()
SOAP::Data::DESTROY: ()
SOAP::Data::DESTROY: ()
SOAP::Data::DESTROY: ()
####
BEGIN { $INC{'Demo.pm'} = __FILE__; }
####
0.65-beta2 Mon Oct 25 2004
+ Deprecated SOAP::Lite->on_debug removed