IPT Chapter 2
IPT Chapter 2
Chapter 2
Web Services and Middleware; Network programming; Message and queuing
services; Low level data communications
2.1 Web Services and Middleware
Web services:
1
Integrative programming and technologies
1. A client that wants to be serviced should first find the supported services from the
pre-existing registry before compiling a code.
2. After finding its services through searching, the client gains the Web Service
Description Language (WSDL) that a server previously registers. From the WSDL,
the client knows the service provider location and the parameters to the found
method.
3. After the client binds the described service during the compile time, it calls the
local agent whenever the client invokes a method call, and the local agent delivers
it to the server side agent through Simple Object Access Protocol (SOAP) over
HTTP, FTP, SMTP, IIOP, and TCP during the runtime.
4. The server side agent activates the appropriate object, and delivers the calls to the
object.
All of the communication methods such as a WSDL, and SOAP exploit the
eXtensible Markup Language (XML) . WSDL is an XML describing the web
service. SOAP is an XML describing the called method, its parameters, and its
return value, can be delivered over the HTTP.
2
Integrative programming and technologies
Protocol:
• A protocol is a precise set of rules defining how computers communicate:
the format of addresses, how data is split into packets, and so on.
• There are many different protocols defining different aspects of network
communication.
IP:
• IP was designed to allow multiple routes between any two points and to route
packets of data around damaged routers .
TCP:
• Since there are multiple routes between two points, and since the quickest
path between two points may change over time as a function of network traffic
and other factors), the packets that make up a particular data stream may not
all take the same route.
• Furthermore, they may not arrive in the order they were sent, if they even
arrive at all.
UDP:
• UDP is an unreliable protocol that does not guarantee that packets will
arrive at their destination or that they will arrive in the same order they were
sent.
Ports:
• Each computer with an IP address has several thousand logical ports.
• Each port is identified by a number between 1 and 65,535. Each port can
be allocated to a particular service.
• Port numbers 1 through 255 are reserved by IP for well-known services. A
well-known service is a service that is widely implemented which resides at a
published, "well-known", port. If you connect to port 80 of a host, for
instance, you may expect to find an HTTP server.
3
Integrative programming and technologies
Client/Server Computing
You can use the Java language to communicate with remote file systems using a
client/server model. A server listens for connection requests from clients across the
network or even from the same machine. Clients know how to connect to the
server via an IP address and port number. Upon connection, the server reads the
request sent by the client and responds appropriately. In this way, applications can
be broken down into specific tasks that are accomplished in separate locations.
The data that is sent back and forth over a socket can be anything you like.
Normally, the client sends a request for information or processing to the server,
which performs a task or sends data back. The IP and port number of the server
is generally well-known and advertised so the client knows where to find the
service.
How UDPclients and UDPservers communicate over sockets
Creating UDP Servers:
To create a server with UDP, do the following:
1. Create a DatagramSocket attached to a port.
int port = 1234;
DatagramSocket socket = new DatagramSocket(port);
4
Integrative programming and technologies
5
Integrative programming and technologies
6
Integrative programming and technologies
7
Integrative programming and technologies
8
Integrative programming and technologies
9
Integrative programming and technologies
10