[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: HTTP API - two step communications.



   Mike,

   here is the code ...�
   clearSrvPgm(); � � � � � � � � � � � � � � � � ��   setContent('*none'); � � � � � � � � � � � � � ��   � � � � � � � � � � � � � � � � � � � � � � �   � �   xmlFromStmf('/jsonTest2.json'); � � � � � � � � �   jsonToXml(xmlAddr:xmlSize); � � � � � � � � � � �   echoToStmf('/jsonTest2.xml':1208); � � � � � � ��   � � � � � � � � � � � � � � � � � � � � � � �   � �   setContent(); � � � � � � � � � � � � � � � � � �   xmlFromStmf('/jsonTest2.xml'); � � � � � � � � ��   xmlReaderInz(xmlAddr:xmlSize); � � � � � � � � ��   dow 0 = xmlReader; � � � � � � � � � � � � � � ��   � if xmlGetNode = 'column1' and xmlGetAttr = '';�   � � echo(xmlGetData + '<p />'); � � � � � � � � �   � endif; � � � � � � � � � � � � � � � � � � �   ��   enddo; � � � � � � � � � � � � � � � � � � � �   ��   echoToClient(); � � � � � � � � � � � � � � � � �   *inlr = *on; � � � � � ��   [1]http://216.109.205.54:8080/pextcgiCOR/case5.pgm
   �� � � � � � � ��   On Tue, Oct 11, 2011 at 6:12 PM, Mike Krebs
   <[2]mkrebs@xxxxxxxxxxxxxxxxxx> wrote:

     Chuck, look at the URL...you need to enter valid street, city,
     state, ts (zip) like this:
     [3]http://factfinder2.census.gov/rest/addressSearch/search?street=1
     425%20H%20st&city=Lincoln&state=Nebraska&&_ts=685083759
     JSON is an important data interchange format.
     [4]http://www.json.org/ �It is a structured data format usually
     without meta data (in other words you need to understand what it
     is). Braces, commas, quotes, brackets and colons are important
     delimiters. [5]http://rpgnextgen.com/index.php?content=json for a
     JSON service program or just parse yourself down to the element you
     are looking for (possibly "column2":"School District, Unified"?).
     Here is what is returned when you put in the address above:

   {"AllRecords":{ "SearchRecords":{"Results":
   {
   "rowsPerPageOptions":[25,50,75],
   "sort":"",
   "dir":"",
   "callingurlparams":"",
   "TotalNumRecsAvailable": 0,
   "TotalResultsReturned":10,
   "CurrentPage":1,
   "NumPages":1,
   "StartRecNum":"",
   "EndingRecNum":"",
   "DisplayProperties":"p_record_canonical_name:Geography
   Name,p_geography_summary_level_name:Geography
   Type,info:About,p_geography_summary_level_code:Geography Summary Level
   Code,p_geography_summary_level_code:Geography Summary Level
   Code,d_geography_year:Geographic
   Vintage,d_geography_pseudo_geography_ind:Pseudo Geography
   Indicator,p_geography_year_state:Geography Year State",
   "GeoMessage":"",
   "FipscodeSearchInterface":"",
   "FipsclasscodeSearchInterface":"",
   "AnsicodeSearchInterface":"",
   "LsadcodeSearchInterface":"",
   "GeoSearchInterface":"",
   "BlockIndexVintageList":"",
   "DefaultMatchMode":"",
   "SelectedProductsInSession":"",
   "ProductIncludeArchive":"",
   "batchLimit":""
   ,

     "matchingAddress":"1425 H St, LINCOLN, NE 68508",
     "selectedVintage":"2010",
     "totalAddressRecords":"14",

   "sort":"",
   "dir":"",
   "ResultSet":
   [

     {
     "column1":"ZCTA5 68508",

   "column2":"5-Digit ZIP Code Tabulation Area",
   "column3":"860",

     "url":"/rest/geoSearch/nav?p_record_canonical_name=ZCTA5
     68508&amp;p_geography_summary_level_name=5-Digit ZIP Code
     Tabulation
     Area&amp;p_geography_summary_level_code=860&amp;d_geography_year=20
     10&amp;d_record_type=geography&amp;filterAction=A&amp;N=0"
     }
     ,{
     "column1":"Block 1005, Block Group 1, Census Tract 20.01, Lancaster
     County, Nebraska",

   "column2":"Block",
   "column3":"100",

     "url":"/rest/geoSearch/nav?p_record_canonical_name=Block 1005,
     Block Group 1, Census Tract 20.01, Lancaster County,
     Nebraska&amp;p_geography_summary_level_name=Block&amp;p_geography_s
     ummary_level_code=100&amp;d_geography_year=2010&amp;d_record_type=g
     eography&amp;filterAction=A&amp;N=0"
     }
     ,{
     "column1":"Block Group 1, Census Tract 20.01, Lancaster County,
     Nebraska",

   "column2":"Block Group",
   "column3":"150",

     "url":"/rest/geoSearch/nav?p_record_canonical_name=Block Group 1,
     Census Tract 20.01, Lancaster County,
     Nebraska&amp;p_geography_summary_level_name=Block
     Group&amp;p_geography_summary_level_code=150&amp;d_geography_year=2
     010&amp;d_record_type=geography&amp;filterAction=A&amp;N=0"
     }
     ,{
     "column1":"Census Tract 20.01, Lancaster County, Nebraska",

   "column2":"Census Tract",
   "column3":"140",

     "url":"/rest/geoSearch/nav?p_record_canonical_name=Census Tract
     20.01, Lancaster County,
     Nebraska&amp;p_geography_summary_level_name=Census
     Tract&amp;p_geography_summary_level_code=140&amp;d_geography_year=2
     010&amp;d_record_type=geography&amp;filterAction=A&amp;N=0"
     }
     ,{
     "column1":"Congressional District 1 (111th Congress), Nebraska",

   "column2":"Congressional District",
   "column3":"500",

     "url":"/rest/geoSearch/nav?p_record_canonical_name=Congressional
     District 1 (111th Congress),
     Nebraska&amp;p_geography_summary_level_name=Congressional
     District&amp;p_geography_summary_level_code=500&amp;d_geography_yea
     r=2010&amp;d_record_type=geography&amp;filterAction=A&amp;N=0"
     }
     ,{
     "column1":"Lancaster County, Nebraska",

   "column2":"County",
   "column3":"050",

     "url":"/rest/geoSearch/nav?p_record_canonical_name=Lancaster
     County,
     Nebraska&amp;p_geography_summary_level_name=County&amp;p_geography_
     summary_level_code=050&amp;d_geography_year=2010&amp;d_record_type=
     geography&amp;filterAction=A&amp;N=0"
     }
     ,{
     "column1":"Lincoln city, Lancaster County, Nebraska",

   "column2":"County Subdivision",
   "column3":"060",

     "url":"/rest/geoSearch/nav?p_record_canonical_name=Lincoln city,
     Lancaster County,
     Nebraska&amp;p_geography_summary_level_name=County
     Subdivision&amp;p_geography_summary_level_code=060&amp;d_geography_
     year=2010&amp;d_record_type=geography&amp;filterAction=A&amp;N=0"
     }
     ,{
     "column1":"Lincoln, NE �Metro Area",

   "column2":"Metropolitan Statistical Area/Micropolitan Statistical
   Area",
   "column3":"310",

     "url":"/rest/geoSearch/nav?p_record_canonical_name=Lincoln, NE
     �Metro Area&amp;p_geography_summary_level_name=Metropolitan
     Statistical Area/Micropolitan Statistical
     Area&amp;p_geography_summary_level_code=310&amp;d_geography_year=20
     10&amp;d_record_type=geography&amp;filterAction=A&amp;N=0"
     }
     ,{
     "column1":"Lincoln city, Nebraska",

   "column2":"Place",
   "column3":"160",

     "url":"/rest/geoSearch/nav?p_record_canonical_name=Lincoln city,
     Nebraska&amp;p_geography_summary_level_name=Place&amp;p_geography_s
     ummary_level_code=160&amp;d_geography_year=2010&amp;d_record_type=g
     eography&amp;filterAction=A&amp;N=0"
     }
     ,{
     "column1":"Lincoln Public Schools, Nebraska",

   "column2":"School District, Unified",
   "column3":"970",

     "url":"/rest/geoSearch/nav?p_record_canonical_name=Lincoln Public
     Schools, Nebraska&amp;p_geography_summary_level_name=School
     District,
     Unified&amp;p_geography_summary_level_code=970&amp;d_geography_year
     =2010&amp;d_record_type=geography&amp;filterAction=A&amp;N=0"
     }
     ,{
     "column1":"Nebraska",

   "column2":"State",
   "column3":"040",

     "url":"/rest/geoSearch/nav?p_record_canonical_name=Nebraska&amp;p_g
     eography_summary_level_name=State&amp;p_geography_summary_level_cod
     e=040&amp;d_geography_year=2010&amp;d_record_type=geography&amp;fil
     terAction=A&amp;N=0"
     }
     ,{
     "column1":"No Lower Chamber Districts �(2010), Nebraska",

   "column2":"State Legislative District, Lower Chamber",
   "column3":"620",

     "url":"/rest/geoSearch/nav?p_record_canonical_name=No Lower Chamber
     Districts �(2010),
     Nebraska&amp;p_geography_summary_level_name=State Legislative
     District, Lower
     Chamber&amp;p_geography_summary_level_code=620&amp;d_geography_year
     =2010&amp;d_record_type=geography&amp;filterAction=A&amp;N=0"
     }
     ,{
     "column1":"State Senate District 28 (2010), Nebraska",

   "column2":"State Legislative District, Upper Chamber",
   "column3":"610",

     "url":"/rest/geoSearch/nav?p_record_canonical_name=State Senate
     District 28 (2010),
     Nebraska&amp;p_geography_summary_level_name=State Legislative
     District, Upper
     Chamber&amp;p_geography_summary_level_code=610&amp;d_geography_year
     =2010&amp;d_record_type=geography&amp;filterAction=A&amp;N=0"
     }
     ,{
     "column1":"4A Precinct, Lancaster County, Nebraska",

   "column2":"Voting District/Remainder",
   "column3":"700",

     "url":"/rest/geoSearch/nav?p_record_canonical_name=4A Precinct,
     Lancaster County,
     Nebraska&amp;p_geography_summary_level_name=Voting
     District/Remainder&amp;p_geography_summary_level_code=700&amp;d_geo
     graphy_year=2010&amp;d_record_type=geography&amp;filterAction=A&amp
     ;N=0"
     }
     ]

   }
   }
   }}
   ----------------------------------------------------------------------
   -
   This is the FTPAPI mailing list. �To unsubscribe, please go to:
   [6]http://www.scottklement.com/mailman/listinfo/ftpapi
   ----------------------------------------------------------------------
   -

   --
   Regards,
   Henrik Rützou
   �   [7]http://powerEXT.com
   �   [plogofull200.png]

References

   1. http://216.109.205.54:8080/pextcgiCOR/case5.pgm
   2. mailto:mkrebs@xxxxxxxxxxxxxxxxxx
   3. http://factfinder2.census.gov/rest/addressSearch/search?street=1425%20H%20st&city=Lincoln&state=Nebraska&&_ts=685083759
   4. http://www.json.org/
   5. http://rpgnextgen.com/index.php?content=json
   6. http://www.scottklement.com/mailman/listinfo/ftpapi
   7. http://powerext.com/
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------