jasonwucinski
New member
Hello everyone,
I am new to groovy/grails as well as this forum. If i have posted in the wrong spot, please excuse me. I am working on creating a groovy/grails project that works with oauth plugin (i am using SpringSource as my development environment) to connect to linkedin profile. i have a controller that connects and captures the data (using REST). Everything seems to work fine. the controller uses this:
and returns an object that, when printed out with print(response), looks like this:
my question is this: How do i parse the response variable? for instance, what if i want to pick out the first-name and do something with it? My next question would be: How do i deal with repeating data, but I will see how this one goes first.
Thank you
jason
I am new to groovy/grails as well as this forum. If i have posted in the wrong spot, please excuse me. I am working on creating a groovy/grails project that works with oauth plugin (i am using SpringSource as my development environment) to connect to linkedin profile. i have a controller that connects and captures the data (using REST). Everything seems to work fine. the controller uses this:
Code:
def response = oauthService.accessResource(
apiUrl, 'linkedin', [key:session.oauthToken.key, secret:session.oauthToken.secret], 'GET')
and returns an object that, when printed out with print(response), looks like this:
HTML:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<person>
<id>some string</id>
<first-name>MyFirstName</first-name>
<last-name>MyLastName</last-name>
</person>
my question is this: How do i parse the response variable? for instance, what if i want to pick out the first-name and do something with it? My next question would be: How do i deal with repeating data, but I will see how this one goes first.
Thank you
jason