[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: HTTP API - two step communications.
Mike,
and my next conversion tool will be UN/EDIFACT <> XML:
UNA:+.? ' � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ��
UNB+UNOC:2+5790000017089:14:DKECCO+5790000251896:14+110913:2110+4251'
� � � ��
UNH+1+INVOIC:D:96A:UN:EAN008' � � � � � � � � � � � � � � � � � � � � � � � ��
BGM+380+0197711666+9' � � � � � � � � � � � � � � � � � � � � � � � � � � � ��
DTM+137:20110913:102' � � � � � � � � � � � � � � � � � � � � � � � � � � � ��
DTM+209:20110913:102' � � � � � � � � � � � � � � � � � � � � � � � � � � � ��
PAI+1' � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �
NAD+CA+0000109040::91++DHL Freight Danmark
A/S+Jydekrogen+Vallensbæk++2625+DK'
NAD+SU+5790000260669::9' � � � � � � � � � � � � � � � � � � � � � � � � � � �
RFF+VA:DK18585995'
will become:
[1]http://216.109.205.54:8080/NAD_96Atest.xml
�� � � � � � � � � � � � � � � � � � � � � � � � � � � � � �
On Tue, Oct 11, 2011 at 8:38 PM, Henrik Rützou <[2]hr@xxxxxxxxxxxx>
wrote:
Yes, it is powerEXT Code but xmlgetNode() also works ;-)
your code returns�
"Lincoln Public Schools, Nebraska"
in schoolDistrict�
[3]http://216.109.205.54:8080/pextcgiCOR/case6.pgm
You do not need to trim the result of xmlGetData it returns a 65535
variable field
On Tue, Oct 11, 2011 at 8:13 PM, Mike Krebs
<[4]mkrebs@xxxxxxxxxxxxxxxxxx> wrote:
This is PowerEXT code? I notice it is "clean" code not using
parenthesis on what I assume are procedures (xml...). Clean but
confusing until you get used to it. :)
If Chuck needed to get the "970" data, something like this would
work?
schoolDistrict = *blanks;
dow 0 = xmlReader;
�if xmlGetNode = 'column1' and xmlGetAttr = '';
� �column1Data = %trim(xmlGetData);
�endif;
�if xmlGetNode = 'column3' and xmlGetData = '970';
� �schoolDistrict = column1Data;
� �leave;
�endif;
enddo;
-----Original Message-----
From: [5]ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
[mailto:[6]ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Henrik
Rützou
Sent: Tuesday, October 11, 2011 12:15 PM
To: HTTPAPI and FTPAPI Projects
Subject: 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;
[7]http://216.109.205.54:8080/pextcgiCOR/case5.pgm
On Tue, Oct 11, 2011 at 6:12 PM, Mike Krebs
<[8]mkrebs@xxxxxxxxxxxxxxxxxx>wrote:
> Chuck, look at the URL...you need to enter valid street, city,
state, ts
> (zip) like this:
>
>
[9]http://factfinder2.census.gov/rest/addressSearch/search?street=1425
%20H%20st&city=Lincoln&state=Nebraska&&_ts=685083759
>
> JSON is an important data interchange format.
[10]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.
[11]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&p_geography_summary_level_name=5-Digit ZIP Code Tabulation
>
Area&p_geography_summary_level_code=860&d_geography_year=2010&
amp;d_record_type=geography&filterAction=A&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&p_geography_summary_level_name=Block&p_geography_summ
ary_level_code=100&d_geography_year=2010&d_record_type=geograp
hy&filterAction=A&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&p_geography_summary_level_name=Block
>
Group&p_geography_summary_level_code=150&d_geography_year=2010
&d_record_type=geography&filterAction=A&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&p_geography_summary_level_name=Census
>
Tract&p_geography_summary_level_code=140&d_geography_year=2010
&d_record_type=geography&filterAction=A&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&p_geography_summary_level_name=Congressional
>
District&p_geography_summary_level_code=500&d_geography_year=2
010&d_record_type=geography&filterAction=A&N=0"
> }
> ,{
> "column1":"Lancaster County, Nebraska",
> "column2":"County",
> "column3":"050",
> "url":"/rest/geoSearch/nav?p_record_canonical_name=Lancaster County,
>
Nebraska&p_geography_summary_level_name=County&p_geography_sum
mary_level_code=050&d_geography_year=2010&d_record_type=geogra
phy&filterAction=A&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&p_geography_summary_level_name=County
>
Subdivision&p_geography_summary_level_code=060&d_geography_yea
r=2010&d_record_type=geography&filterAction=A&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&p_geography_summary_level_name=Metropolitan Statistical
> Area/Micropolitan Statistical
>
Area&p_geography_summary_level_code=310&d_geography_year=2010&
amp;d_record_type=geography&filterAction=A&N=0"
> }
> ,{
> "column1":"Lincoln city, Nebraska",
> "column2":"Place",
> "column3":"160",
> "url":"/rest/geoSearch/nav?p_record_canonical_name=Lincoln city,
>
Nebraska&p_geography_summary_level_name=Place&p_geography_summ
ary_level_code=160&d_geography_year=2010&d_record_type=geograp
hy&filterAction=A&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&p_geography_summary_level_name=School District,
>
Unified&p_geography_summary_level_code=970&d_geography_year=20
10&d_record_type=geography&filterAction=A&N=0"
> }
> ,{
> "column1":"Nebraska",
> "column2":"State",
> "column3":"040",
>
>
"url":"/rest/geoSearch/nav?p_record_canonical_name=Nebraska&p_geog
raphy_summary_level_name=State&p_geography_summary_level_code=040&
amp;d_geography_year=2010&d_record_type=geography&filterAction
=A&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&p_geography_summary_level_name=State
> Legislative District, Lower
>
Chamber&p_geography_summary_level_code=620&d_geography_year=20
10&d_record_type=geography&filterAction=A&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&p_geography_summary_level_name=State
Legislative
> District, Upper
>
Chamber&p_geography_summary_level_code=610&d_geography_year=20
10&d_record_type=geography&filterAction=A&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&p_geography_summary_level_name=Voting
>
District/Remainder&p_geography_summary_level_code=700&d_geogra
phy_year=2010&d_record_type=geography&filterAction=A&N=0"
> }
> ]
> }
> }
> }}
>
----------------------------------------------------------------------
-
> This is the FTPAPI mailing list. �To unsubscribe, please go to:
> [12]http://www.scottklement.com/mailman/listinfo/ftpapi
>
----------------------------------------------------------------------
-
>
--
Regards,
Henrik Rützou
�[13]http://powerEXT.com <[14]http://powerext.com/>
----------------------------------------------------------------------
-
This is the FTPAPI mailing list. �To unsubscribe, please go to:
[15]http://www.scottklement.com/mailman/listinfo/ftpapi
----------------------------------------------------------------------
-
--
Regards,
Henrik Rützou
� [16]http://powerEXT.com
� [plogofull200.png]
--
Regards,
Henrik Rützou
�
[17]http://powerEXT.com
�
[plogofull200.png]
References
1. http://216.109.205.54:8080/NAD_96Atest.xml
2. mailto:hr@xxxxxxxxxxxx
3. http://216.109.205.54:8080/pextcgiCOR/case6.pgm
4. mailto:mkrebs@xxxxxxxxxxxxxxxxxx
5. mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
6. mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
7. http://216.109.205.54:8080/pextcgiCOR/case5.pgm
8. mailto:mkrebs@xxxxxxxxxxxxxxxxxx
9. http://factfinder2.census.gov/rest/addressSearch/search?street=1425%20H%20st&city=Lincoln&state=Nebraska&&_ts=685083759
10. http://www.json.org/
11. http://rpgnextgen.com/index.php?content=json
12. http://www.scottklement.com/mailman/listinfo/ftpapi
13. http://powerEXT.com/
14. http://powerext.com/
15. http://www.scottklement.com/mailman/listinfo/ftpapi
16. http://powerext.com/
17. http://powerext.com/
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------