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. Logic for credit card number validation:
Step 1: Multiply the alternate digits of the credit card number by 2 starting with the second digit from the right (the first right--hand digit is the check digit).
Step 2: Add the individual digits comprising the products obtained in Step 1 to each of the unaffected digits in the original number.
Step 3: The sum of all digits obtained after Step 2 as well as unaffected digits must be a number which is a multiple of 10 (30, 40, 50, etc.) for the credit card number to be valid.
Chúng ta sẽ thực hiện như sau :
| Tạo Java Web Application và tạo webservice | 
| Code trong web service như trên | 
| Test thử web service vừa tạo | 
| Tạo Web Service Client | 
| Copy đường dẫn WSDL khi tạo Web Service Client | 
| Để kết nối được với nhau ta kéo method validateCart vào trong main class. | 
| viết code trong main | 
| Kết quả thu được | 
NHẬN XÉT :
-Có thể thực hiện edit web service mà không lo ảnh hưởng tới client.
-Có thể sử dụng cho nhiều client
 
Không có nhận xét nào:
Đăng nhận xét