Thứ Ba, 19 tháng 8, 2014

Build restful web service

Build restful web service

Exercise : Create an restful web services to bring weather information to your customer

I - Create a java libary to use in both serverr and client side

  
Create two java classes named Weather and WeatherList to present two entities item and item list
Weather class content
WeatherList class cotent
 

-Create a web app to implement rest service

  
-Import library made above for this app
  

new a restful web java from pattern 
  \
Write content for ItemsResource
Deploy the web app and test resousrce uri


 

New another web app as client side based jsf, aslo import the lib above for it . 
create a web service client 
 

Create a managed bean 

In xhtml page

Deploy and The result displayed as follow:
 

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

Đăng nhận xét