Java Reference
In-Depth Information
Finally, you'll illustrate another aspect of the API, and prove that your portfolio creation meth-
od worked, by getting the list of all of the portfolios associated with this account. All you
have to do in the getPortfolios method is create a new socket connection and invoke the
RESTful URI at /finance/feeds/default/portfolios , which returns the list of portfolios
for this account, using the security token you saved earlier.
Here is the output from running the program, with a touch of formatting for readability and
the replacement of account data:
Invoking Google to get Auth Token.
HTTP/1.0 200 OK
Content-Type: text/plain
Cache-control: no-cache, no-store
Pragma: no-cache
Expires: Mon, 01-Jan-1990 00:00:00 GMT
Date: Mon, 15 Sep 2008 03:28:23 GMT
Content-Length: 563
Server: GFE/1.3
Connection: Close
SID=DQAAAH0AAAA3FKWU...-AtltIlsfPdU62RP0B31cqnRzErHL9ppsg
LSID=DQAAAH8AAAAffNC...-E_kPEN76bcZewVajOu3s6zjVlmPa0qUzyuzRUaw
Auth=DQAAAH8AAAAffNC...-AYIySHu9BMnDrJ4UDZA3Jrb1n4mCaoBg
Got AUTH TOKEN=DQAAAH8A...-AYIySHu9BMnDrJ4UDZA3Jrb1n4mCaoBg
ADD REQUEST BODY:
<entry xmlns='http://www.w3.org/2005/Atom'
xmlns:gf='http://schemas.google.com/finance/2007'
xmlns:gd='http://schemas.google.com/g/2005'>
<title type='text'>My Restful Portfolio</title>
<gf:portfolioData currencyCode='USD'/>
</entry>
Reading ADD PORTFOLIO POST Response...
HTTP/1.0 201 Created
Content-Type: application/atom+xml; charset=UTF-8
Cache-Control: max-age=0, must-revalidate, private
GData-Version: 1.0
Location: http://finance.google.com/finance/feeds/default/portfolios/3
Content-Location: http://finance.google.com/finance/feeds/default/
portfolios/3
Date: Mon, 15 Sep 2008 03:28:24 GMT
Server: GFE/1.3
Connection: Close
<?xml version='1.0' encoding='UTF-8'?>
Search WWH ::




Custom Search