Design and Implementation of Web Services Based GPRS Automatic Meter Reading System
Design and Implementation of Web Services Based GPRS Automatic Meter Reading System
Reading System
Authorized licensed use limited to: SARDAR VALLABHBHAI NATIONAL INSTITUTE OF TECH. Downloaded on August 31,2023 at 12:04:47 UTC from IEEE Xplore. Restrictions apply.
2010 3rd International Conference on Advanced Computer Theory and Engineering(ICACTE)
V4-361
Authorized licensed use limited to: SARDAR VALLABHBHAI NATIONAL INSTITUTE OF TECH. Downloaded on August 31,2023 at 12:04:47 UTC from IEEE Xplore. Restrictions apply.
2010 3rd International Conference on Advanced Computer Theory and Engineering(ICACTE)
The Socket class and ServerSocket class in the Java.net connection will be closed after the data collection
package is used to realize Socket programming. The latter is process is finished.
used at the server-side while the former used at the client
side. The communication process between the front-end and VI. THE IMPLEMENTION OF WEB SERVICES BASED
LL
Main Thread ""kg,""" Th,,,d
___ � __ ..===-------;
-- @WebService
@Remote( {DataCollectionBeanRemote.class})
! @Stateless
public class DataCollectionBean implements
c_______________ - '
DataCollectionBeanRemote {
______________ -
.,� I
@WebMethod
public double getElectricQuality (Terminal n) throws
,_____"--- ----'r-'-
__________________
-______ u___ �- 1 I I I I �-! TransException {
Priority Queue
II Concrete operations }
II Other methods that will be published as Web
Services
}
@Stateless declares this class to be a Stateless Session
Figure 2_ Multi-threaded Mechanism Bean;
@Remote declares the EJB remote interface that will be
The meter data collection between the Master Station, the implemented;
Front ends and the Terminals is realized by command-driven @WebService declares this Session Bean to have one or
mode. The specific communication process is as follows: more methods published as Web Services;
• In order to get some terminal's meter data, the Mater @WebMethod declares the method to be published as
Station sends a Socket connection request to the Web Services.
front end; After publishing the above codes to the EJB container,
• After the connection between two sides established, such as JBoss server, the container will automatically publish
the Master Station send a data acquisition command them to be Web Services and generate a WSDL(Web Service
to the front end; Description Language) file.
• The Main thread of the front end will put the If a client wants call the published Web Services, it has to
command to the tail of Priority Queue; develop client applications. The wsimport command-line
• The Background Thread take a command out from tool can operate an existing WSDL file and generate the
the Priority Queue, then allocate it to a worker thread required portable artificial for developing lAX-WS Web
in the thread pool. The worker thread sends the Service applications. The following are the cliect key codes
command to the selected terminal; based on lAX-WS specification.
• The terminal will execute this command, and send DataCollectionBeanRemote dao new
the results to end of a data receiving queue of the DataCollectionBeanRemote 0;
front end; DataCollection dc = dao.getDataCollection PortO;llget
• The front end read the data from the data receiving Web Services endpoint
queue and send it to the Master Station; dc.getElectricQuality(Terminal n);/I call the Web Service
• The Master Station receives the data and parse it in method.
accordance with appropriate communication
protocol to get the meter data. At last the Socket
V4-362
Authorized licensed use limited to: SARDAR VALLABHBHAI NATIONAL INSTITUTE OF TECH. Downloaded on August 31,2023 at 12:04:47 UTC from IEEE Xplore. Restrictions apply.
2010 3rd International Conference on Advanced Computer Theory and Engineering(ICACTE)
VII. CONCLUSION
REFERENCES
V4-363
Authorized licensed use limited to: SARDAR VALLABHBHAI NATIONAL INSTITUTE OF TECH. Downloaded on August 31,2023 at 12:04:47 UTC from IEEE Xplore. Restrictions apply.