Using tabledata as Responsefields in a webservice

Post any questions you have about using the Verj.io Studio, including client and server-side programming with Javascript or FPL, and integration with databases, web services etc.

Moderators: Jon, Steve, Ian, Dave

User avatar
dvanhussel
Ebase User
Posts: 161
Joined: Fri Oct 19, 2007 12:45 pm
Location: Haarlem, the Netherlands

Using tabledata as Responsefields in a webservice

#1

Postby dvanhussel » Thu Mar 20, 2008 2:28 pm

How can I use tabledata in the response of a Integration Server webservice?

I load a databaserecordset based on the requestfield into a table. When I set an 'extra' field to the value of a tablefield and use this extra field as the responsefield, the response of the generated webservice is as expected. (So the results of the databasequery are correct)

I would like to use ALL the values of 2 tablefields in the response. When I select the table, the table and the 2 fields or just the 2 fields, the response of the generated webservice is empty.

What is te right way to do this?

These are the fields that I can use as response field:

Image

Thanks in advance and heapy easter!
0 x

User avatar
Wai
Moderator
Moderator
Posts: 165
Joined: Wed Sep 12, 2007 9:04 am
Location: Sandy, UK
Contact:

#2

Postby Wai » Tue Mar 25, 2008 10:57 am

Are you just trying to fetch a record from your database table and return two fields from that record in the response?

If so, in your integration resource, you need to create a repeating element in your response document to represent the table. The repeating element will then have child elements that represent the table's fields. Each of these elements need to be attached to a resource field.

If you use the Create Integration Resource Wizard, this will all be done for you.

On your integration service, you will first need to set up the tables, do the following:

- table (table1) with backing database resource (fetch data from the database)
- table (table2) with backing integration resource
- script with the following:

FETCHTABLE table1;
COPYTABLE table1 TO table2;
UPDATETABLE table2;

Therefore, we first fetch the data from the database into table1. Then we copy this data into table2. The updatetable command updates the integration resource response document with the table data.

Is any of that helpful?
0 x

User avatar
dvanhussel
Ebase User
Posts: 161
Joined: Fri Oct 19, 2007 12:45 pm
Location: Haarlem, the Netherlands

#3

Postby dvanhussel » Tue Mar 25, 2008 3:52 pm

I'm fetching multiple records from the database and want to output multiple fields for all of the fetched records. Like in this example:

Code: Select all

<man&#58;RESPONSE>
    <man&#58;USERNAME>user1</man&#58;USERNAME>
    <man&#58;VOLLEDIGENAAM>David</man&#58;VOLLEDIGENAAM>
</man&#58;RESPONSE>
<man&#58;RESPONSE>
    <man&#58;USERNAME>user2</man&#58;USERNAME>
    <man&#58;VOLLEDIGENAAM>Kees</man&#58;VOLLEDIGENAAM>
</man&#58;RESPONSE>
<man&#58;RESPONSE>
    <man&#58;USERNAME>user3</man&#58;USERNAME>
    <man&#58;VOLLEDIGENAAM>Marco</man&#58;VOLLEDIGENAAM>
 </man&#58;RESPONSE>

I solved my 'problem' by using the method that you described. I use the following response-fields:

Code: Select all

RESPONSETABLE
RESPONSETABLE-USERNAME
RESPONSETABLE-VOLLEDIGENAAM
Thank you for your help and kind regards,

David
0 x


Who is online

Users browsing this forum: No registered users and 44 guests