Java script for calling Freind Rest Service