Professional Documents
Culture Documents
DP 14
DP 14
2
14
Web Service Model
Service
Provider
Service
registry
Service
requestor
3
14
Web Service Model
Publish operations
Find operation
Bind operations
4
14
Web Service Model
5
14
Components of Web Services
6
14
SOAP
7
14
SOAP
8
14
UDDI
9
14
WSDL
10
14
WSDL
12
14
Example – A simple Web Service
13
14
Example – A simple Web Service
14
14
02 Web Programming: CGI
• Common Gateway Interface(CGI)
• CGI Applications
• Setting Up a Web Server
• The cgi Module
• Creating the Form Page
• Generating the Results Page
• HTTP Header
Common Gateway Interface(CGI)
2
14
Common Gateway Interface(CGI)
3
14
Common Gateway Interface(CGI)
4
14
CGI Applications
6
14
Setting Up a Web Server
7
14
The cgi Module
8
14
Creating the Form Page
<form action="/cgi-bin/hello.py"
method="get">
First Name: <input type="text"
name="first_name"> <br />
Last Name: <input type="text"
name="last_name" /> <br />
<input type="submit" value="Submit" />
</form>
9
14
Generating the Results Page
form = cgi.FieldStorage()
first_name = form.getvalue('first_name')
last_name = form.getvalue('last_name')
10
14
Generating the Results Page
print ("Content-type:text/html\r\n\r\n")
print ("<html>")
print ("<head>")
print ("<title>Hello - Second CGI Program</title>")
print ("</head>")
print ("<body>")
print ("<h2>Hello %s %s</h2>" % (first_name,
last_name))
print ("</body>")
print ("</html>")
11
14
HTTP Header
12
14
HTTP Header
Header Description
Header Description
Set-Cookie:
Set the cookie passed through the string
String
14
14
03 Building CGI Applications