~ubuntu-branches/ubuntu/saucy/php-soap/saucy

« back to all changes in this revision

Viewing changes to SOAP-0.12.0/example/tcp_daemon.pl

  • Committer: Package Import Robot
  • Author(s): Prach Pongpanich
  • Date: 2013-05-08 15:21:07 UTC
  • mfrom: (1.1.5)
  • Revision ID: package-import@ubuntu.com-20130508152107-x6a6delp9dy112zi
Tags: 0.13.0-1
* New upstream release
* Now using PKG-PHP-PEAR team as maintainer
* Add myself as uploader
* Add debian/gbp.conf file
* Add Vcs-* fields
* Switch to pkg-php-tools and rewrite debian/rules
* Drop debian/docs, upstream don't ship AUTHORS file
* Update copyright file to version 1.0 format
* Update description in debian/control
* Bump compat level to 9
* Bump Standards-Version 3.9.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/perl -w
2
 
use strict;
3
 
 
4
 
=head1 Simple SOAP TCP Server
5
 
 
6
 
    Simple SOAP TCP Server with test class (just to check things are working)
7
 
 
8
 
    Before you run this test server you will need some perl classes, namely:
9
 
        SOAP::Lite
10
 
        Hook::LexWrap (if you want to see some debugging)
11
 
 
12
 
        Flee off to the CPAN if you need them :)
13
 
 
14
 
    To run type 'perl <filename>' and if you dont get any errors, it's time
15
 
    to go write some code to connect.
16
 
=cut
17
 
 
18
 
use SOAP::Transport::TCP qw(trace);
19
 
use Data::Dumper;
20
 
 
21
 
 
22
 
#############
23
 
## if you want to see incoming/outgoing raw xml
24
 
## uncomment the following.
25
 
 
26
 
#use Hook::LexWrap;
27
 
#wrap *IO::SessionData::read, post => \&show_read;
28
 
#wrap *IO::SessionData::write, post => \&show_write;
29
 
 
30
 
##
31
 
#############
32
 
 
33
 
 
34
 
my $daemon = SOAP::Transport::TCP::Server->new(
35
 
    LocalAddr => '127.0.0.1',
36
 
    LocalPort => '82',
37
 
    Listen    => 5,
38
 
    Reuse     => 1
39
 
);
40
 
 
41
 
# dispatch
42
 
$daemon->dispatch_to('SOAP_Example_Server');
43
 
$daemon->handle;
44
 
 
45
 
#############
46
 
## callback functions for Hook::LexWrap;
47
 
##
48
 
 
49
 
# show incoming xml
50
 
sub show_read {
51
 
    print $/,'## read ##',$/;
52
 
    print Dumper($_[0]);
53
 
}
54
 
 
55
 
# show outgoing xml
56
 
sub show_write {
57
 
    print $/,'## write ##',$/;
58
 
    print Dumper($_[0]);
59
 
}
60
 
################################################################################
61
 
 
62
 
 
63
 
 
64
 
################################################################################
65
 
# SOAP_Example_Server
66
 
# Simple test class, method test returns double what you send to it, thats all!
67
 
################################################################################
68
 
package SOAP_Example_Server;
69
 
 
70
 
sub echoString {
71
 
    return $_[1] x 2;
72
 
}
73
 
 
74
 
1;