I'm running WebSpeed 10.1C on Windows 2008 server.
I'm trying to store XML data into a temp-table. The web service returns multiple records and they are not being stored in the temp-table.
Here's the temp-table definition:
def temp-table t-GetRootCategories undo
xml-node-name 'GetRootCategoriesResult'
field Description as char
field Id as char
field Name as char
field Parentid as char
index k-GetRootCategories is unique primary
Id ascending.
Here's a snippet of the XML response:
<GetRootCategoriesResponse>
<GetRootCategoriesResult >
<a:Category>
<aescription />
<a:Id>03bf3128-cb61-463f-85df-8e132e22d693</a:Id>
<a:Name>Tape</a:Name>
<aarentId>0</aarentId>
</a:Category>
<a:Category>
<aescription />
<a:Id>1d4c98a7-cbcd-48eb-aafc-069e7e05c983</a:Id>
<a:Name>Gloves</a:Name>
<aarentId>0</aarentId>
</a:Category>
<a:Category>
<aescription />
<a:Id>10fa359f-f8f6-44a8-a05f-32d1ec1c73e3</a:Id>
<a:Name>Safety Items</a:Name>
<aarentId>0</aarentId>
</a:Category>
</GetRootCategoriesResult>
</GetRootCategoriesResponse>
I get a successful return code after doing the READ-XML method:
TEMP-TABLE t-GetRootCategories:READ-XML("FILE", filename , "EMPTY", ?, ?, ?, ?).
When I do a CAN-FIND (t-GetRootCategories...) it returns a true.
When I do the following:
for each t-GetRootCategories no-lock:
{&OUT}
"t-GetRootCategories.Description: ":U t-GetRootCategories.Description "<BR>"
"t-GetRootCategories.Id: ":U t-GetRootCategories.Id "<BR>"
"t-GetRootCategories.Name: ":U t-GetRootCategories.Name "<BR>"
"t-GetRootCategories.ParentId: ":U t-GetRootCategories.ParentId "<BR></BR>".
end.
The web page displays one records with no data:
t-GetRootCategories.Description:
t-GetRootCategories.Id:
t-GetRootCategories.Name:
t-GetRootCategories.ParentId
When I add a record to the temp-table by hardcoding a CREATE t-GetRootCategories and ASSIGN t-GetRootCategories and then do a READ-XML with option "MERGE" I see the hardcoded record but not the data from the XML response.
Is my temp-table definition correct?
I'm trying to store XML data into a temp-table. The web service returns multiple records and they are not being stored in the temp-table.
Here's the temp-table definition:
def temp-table t-GetRootCategories undo
xml-node-name 'GetRootCategoriesResult'
field Description as char
field Id as char
field Name as char
field Parentid as char
index k-GetRootCategories is unique primary
Id ascending.
Here's a snippet of the XML response:
<GetRootCategoriesResponse>
<GetRootCategoriesResult >
<a:Category>
<aescription />
<a:Id>03bf3128-cb61-463f-85df-8e132e22d693</a:Id>
<a:Name>Tape</a:Name>
<aarentId>0</aarentId>
</a:Category>
<a:Category>
<aescription />
<a:Id>1d4c98a7-cbcd-48eb-aafc-069e7e05c983</a:Id>
<a:Name>Gloves</a:Name>
<aarentId>0</aarentId>
</a:Category>
<a:Category>
<aescription />
<a:Id>10fa359f-f8f6-44a8-a05f-32d1ec1c73e3</a:Id>
<a:Name>Safety Items</a:Name>
<aarentId>0</aarentId>
</a:Category>
</GetRootCategoriesResult>
</GetRootCategoriesResponse>
I get a successful return code after doing the READ-XML method:
TEMP-TABLE t-GetRootCategories:READ-XML("FILE", filename , "EMPTY", ?, ?, ?, ?).
When I do a CAN-FIND (t-GetRootCategories...) it returns a true.
When I do the following:
for each t-GetRootCategories no-lock:
{&OUT}
"t-GetRootCategories.Description: ":U t-GetRootCategories.Description "<BR>"
"t-GetRootCategories.Id: ":U t-GetRootCategories.Id "<BR>"
"t-GetRootCategories.Name: ":U t-GetRootCategories.Name "<BR>"
"t-GetRootCategories.ParentId: ":U t-GetRootCategories.ParentId "<BR></BR>".
end.
The web page displays one records with no data:
t-GetRootCategories.Description:
t-GetRootCategories.Id:
t-GetRootCategories.Name:
t-GetRootCategories.ParentId
When I add a record to the temp-table by hardcoding a CREATE t-GetRootCategories and ASSIGN t-GetRootCategories and then do a READ-XML with option "MERGE" I see the hardcoded record but not the data from the XML response.
Is my temp-table definition correct?