1
This directory contains an example stand-alone gSOAP Web server. It uses the
2
gSOAP HTTP GET plugin to serve HTTP GET requests as well as SOAP/XML HTTP POST
5
This is a small but fully functional (embedded) Web server that can serve both
6
static and dynamic pages and provide SOAP/XML responses.
8
This Web server implements a simple calculator XML Web service for
9
demonstration purposes.
11
This application requires Zlib and Pthreads (you can replace Pthreads with
12
another thread library, but you need to study the OpenSSL Pthread
13
implementation when you plan to use OpenSSL).
15
On Unix/Linux, please enable SIGPIPE handling, see the main function in
16
webserver.c. SIGPIPE handling will avoid your server from termination when
17
sockets are disconnected by clients before the transaction was completed
20
Please don't be tempted to run the webserver with root permission! The best
21
way to protect your site is by creating a dummy account with very limited
22
system access and run the webserver under this account.
24
Compile without OpenSSL:
25
soapcpp2 -c -n -popt opt.h
26
soapcpp2 -c webserver.h
27
Customize your COOKIE_DOMAIN in webserver.c (if you use cookies)
28
gcc -DWITH_COOKIES -DWITH_ZLIB -I../.. -o webserver webserver.c
29
options.c ../../plugin/httpget.c ../../plugin/logging.c
30
../../plugin/threads.c ../../stdsoap2.c soapC.c soapClient.c
31
soapServer.c -lpthread -lz
34
soapcpp2 -c -n -popt opt.h
35
soapcpp2 -c webserver.h
36
gcc -DWITH_OPENSSL -DWITH_COOKIES -DWITH_ZLIB -I../.. -o webserver
37
webserver.c options.c ../../plugin/httpget.c ../../plugin/logging.c
38
../../plugin/threads.c ../../stdsoap2.c soapC.c
39
soapClient.c soapServer.c -lpthread -lz -lssl -lcrypto
42
Compile the web server as explained above
43
Start the web server on an even numbered port (e.g. 8080):
45
Start a web browser and open a (localhost) location:
47
and type userid 'admin' and passwd 'guest' to gain access
49
http://127.0.0.1:8080/calc.html
50
and enter an expression
52
http://127.0.0.1:8080/test.html
53
http://127.0.0.1:8081/webserver.wsdl
56
Create the SSL certificate
57
Compile the web server with OpenSSL as explained above
58
Start the web server on an odd numbered port (e.g. 8081)
60
Actually, you can start two servers, one on 8080 and a secure one on
62
Start a web browser and open a (localhost) location:
63
https://127.0.0.1:8081
64
and type userid 'admin' and passwd 'guest' to gain access
66
https://127.0.0.1:8081/calc.html
67
and enter an expression
69
https://127.0.0.1:8081/test.html
70
https://127.0.0.1:8081/webserver.wsdl
73
Serves SOAP/XML calculation requests
76
-z enables compression
79
-i enables non-threaded iterative server
80
-v enables verbose mode
81
-t<val> sets I/O timeout value (seconds)
82
-s<val> sets server timeout value (seconds)
83
-d<host> sets cookie domain
84
-p<path> sets cookie path
85
-l[none inbound outbound both]