on 07-01-2009 10:45 PM
Hi Experts,
I'm stuck in trying to access data from a web service call made with an Adaptive Web Service model.
Here is what the model context looks like, I'll put the cardinality next to each one.
Root
Request_SearchQuery (0..n)
Response (0..1)
SearchQueryReturn (0..1)
Record (0..n)
Record1 (1..1)
Field (0..n)
Field1 (0..1)
stringValue (valuedata; contains data pertaining to field name)
stringName (metadata; contains field name)
SearchQuery (0..1)
SearchQuery (0..1) takes the initial values to execute the query.
Record (0..n) contains how many rows in the table
Field (0..n) contains how many fields in a row
stringName is the name of the field (ie table column name)
stringValue is the data value for the particular field.
I am having severe trouble looping the fields and records as I do not know what methods to use out of the web dynpro API.
I need to loop through all fields in one record (table row) and then move to the next record and loop all the fields etc. The weird thing is the webservice returns the field name under node Field, and the field value under node Field1.
Please help.
M
To answer your question, I need to know the value of the "singleton"-property for all context nodes.
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Armin,
Please see below, the Singleton property value is added right after the cardinality.
Root
Request_SearchQuery (0..n) (true)
Response (0..1) (true)
SearchQueryReturn (0..1) (true)
Record (0..n) (true)
Record1 (1..1) (true)
Field (0..n) (true)
Field1 (0..1) (true)
stringValue (valuedata; contains data pertaining to field name)
stringName (metadata; contains field name)
SearchQuery (0..1)
These are all model nodes bound to the web service model.
Thanks
Marshall.
Hi Marshall Mathers,
Please find the below code. It will give you some idea.
I couldn't paste the exact code (syntax) since I don't know the singleton property of each node. If you want me to give the exact code please paste your singleton property value of each node.
int noOfRows = wdContext.nodeRecord().size();
for(int row=0;row<noOfRows;row++)
{
wdContext.nodeRecord().getRecordElementAt(row).
get element of Record1 element.
get Field node from Record 1 Node
int fieldsSize = wdContext.nodeField().size();
for(int fields =0; fields<fieldsSize; fields++)
{
String fieldName = wdContext.nodeField().getElementAtXXXXX(fields).getStringName();
String fieldValue = "";
if(size of node field1 > 0)
{
// According to the cardinality, Field1 node will contain either one element or Zero. So no need of any for loop here.
fieldValue = get String value from field1;
}
}
}
Regards,
Jaya.
Edited by: VJR on Jul 2, 2009 11:02 AM
Edited by: VJR on Jul 2, 2009 11:03 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.