How to use restful service then update ui

a working sample code would be nice