Advertisement
Guest User

GN 2.10 test

a guest
Sep 9th, 2013
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var GN_URL = 'http://localhost:8080/geonetwork';
  2. testUsersInfo();
  3. testUserGet(1);
  4. testUserGet(2);
  5.  
  6. function testUsersInfo(){
  7.     Ext.Ajax.request({
  8.         url : GN_URL + '/srv/spa/xml.info?type=users', method: 'GET',
  9.         headers : {
  10.             "Content-Type" : "application/xml"
  11.         },
  12.         success : function(response) {
  13.            console.log(response.responseText);
  14.         },
  15.         failure : function(response) {
  16.            console.log(response);
  17.     }
  18.     });
  19. }
  20.  
  21. function testUserGet(userid){
  22.     Ext.Ajax.request({
  23.         url : GN_URL + '/srv/spa/xml.user.get', method: 'POST', xmlData: '<request><id>' + userid + '</id></request>',
  24.         headers : {
  25.             "Content-Type" : "application/xml"
  26.         },
  27.         success : function(response) {
  28.            console.log(response.responseText);
  29.         },
  30.         failure : function(response) {
  31.            console.log(response.responseText);
  32.     }
  33.     });
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement