Chủ Nhật, 17 tháng 8, 2014

Developing web service using JAX-WS

Demo : Happy Consumer International Bank (HCIB), a leading multinational organization having established branches all over the world is now starting its banking services in India. The Bank has employed you as a full time System Consultant with them. It wants to deploy a Web Service that will offer credit card validation and online banking facilities that are typically offered by all the multinational banks. The main priorities for the online banking system are reliability, availability and serviceability of the application. Additionally, the system should be highly scalable and secure as the bank expects substantial growth in the future. Consider yourself to be a part of the team that implements the credit card validation module. Develop a JAX_RPC based Web Service that exposes the boolean validateCreditCard(cardNumber) method. This method implements the logic for credit card number validation, and returns a boolean value indicating whether the card number is valid or not.

B1:Tạo mới web application,trong project này ta tạo service 



B2:Code phương thức validatdeCart 

B3:Chọn vào service vừa tạo ra,chuột phải chọn Test Service để lấy đường link của webservice

B4:Tạo java application để sư dụng webservice ta vừa tạo ra,trong project ta tạo Webservice client để dùng service vừa tạo.


B5:Code cho hàm main,ta kéo phương thức của webservice vào hàm main để sử dụng



Kết quả:


Source code:đây

Nhận xét:Web service giúp tối ưu hóa ứng dụng
-Dễ dàng chỉnh sửa trên service mà không ảnh hưởng đến client.



Không có nhận xét nào:

Đăng nhận xét