Adding a new row to web service resource table

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

Hurtz
Ebase User
Posts: 9
Joined: Thu Nov 28, 2013 1:53 pm
Location: Germany

Adding a new row to web service resource table

#1

Postby Hurtz » Thu Dec 12, 2013 11:04 am

In my application I'm trying to add a row in a table of a web service resource. Neither the "Add Row" button once the script inserts a row cause a new line. Is there any write protection, I have to disable before?
0 x

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

#2

Postby Wai » Thu Dec 12, 2013 1:54 pm

have you issued an updatetable command?
0 x

Hurtz
Ebase User
Posts: 9
Joined: Thu Nov 28, 2013 1:53 pm
Location: Germany

#3

Postby Hurtz » Thu Dec 12, 2013 2:23 pm

Ok, I've found the error. It was because I had the jquery file is removed from the folder "Javascript". Now adding new lines works again.

The aim of this web service call:

<mbr:ProcessPerson versionID="6.0.0.4">
<oa:ApplicationArea xsi:type="_wcf:ApplicationAreaType">
<oa:CreationDateTime>2008-05-22T14:32:12.375Z</oa:CreationDateTime>
<oa:BODID>64c38f00-282d-11dd-baf2-832f4835bc2c</oa:BODID>
<_wcf:BusinessContext>
<_wcf:ContextData name="storeId">10101</_wcf:ContextData>
</_wcf:BusinessContext>
</oa:ApplicationArea>
<_mbr:DataArea>
<oa:Process>
<oa:ActionCriteria>
<oa:ActionExpression actionCode="AuthenticatePassword" expressionLanguage="_wcf:XPath"/>
</oa:ActionCriteria>
</oa:Process>
<_mbr:Person>
<_mbr:Credential>
<_mbr:LogonID>wcsadmin</_mbr:LogonID>
<_mbr:Password>wcs1admin</_mbr:Password>
</_mbr:Credential>
<_mbr:PersonalProfile/>
<_mbr:ContactInfo>
<_wcf:ContactInfoIdentifier>
<_wcf:ExternalIdentifier/>
</_wcf:ContactInfoIdentifier>
<_wcf:Address/>
</_mbr:ContactInfo>
</_mbr:Person>
</_mbr:DataArea>
</_mbr:ProcessPerson>


Even though I would add a line to the table "Action Expression" and add the values &#8203;&#8203;for actionCode and expressionLanguage as set in the example (same for the table "Person" where I set LogonId und Password), the entire block <_mbr:DataArea> will not be sent in the SOAP request. I checked the Soap output with Wireshark. I know that I have a mistake somewhere in there, but I do not understand it. It must be due to the tables. The "individual fields" like Bodid and Creation DateTime are in the request.

Conclusion: Column field values &#8203;&#8203;are not included in the Request
0 x

Jon
Moderator
Moderator
Posts: 1342
Joined: Wed Sep 12, 2007 12:49 pm

#4

Postby Jon » Thu Dec 12, 2013 3:25 pm

You must issue an updatetable for any tables (as opposed to fields) that appear in the web service document you want to send e.g.

Code: Select all

tables.TABLE1.updateTable&#40;&#41;;
resources.WEBSERVICE1.call&#40;&#41;;
The updatetable transfers the table data (row and column data) for that one table from the form into the web service document.

Regards
Jon
0 x

Jon
Moderator
Moderator
Posts: 1342
Joined: Wed Sep 12, 2007 12:49 pm

#5

Postby Jon » Thu Dec 12, 2013 3:28 pm

Another suggestion: click the debug checkbox in the Web Service Resource then your request and response documents will be logged. You can view this with View > Execution log in the designer.
0 x

Hurtz
Ebase User
Posts: 9
Joined: Thu Nov 28, 2013 1:53 pm
Location: Germany

#6

Postby Hurtz » Thu Dec 12, 2013 3:36 pm

Thanks for the tip with the Execution Log. This is my Script for the Web Resource:

importPackage(com.ebasetech.xi.api);
importPackage(com.ebasetech.xi.services);

tables.ACTIONEXPRESSION.updateTable();
tables.PERSON.updateTable();
resources.MEMBERSERVICES.update();
resources.MEMBERSERVICES.call();


Nevertheless, the Soap request looks like this:

Payload: <?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<mem:ProcessPerson xmlns:mem="http://www.ibm.com/xmlns/prod/commerce/9/member" versionID="6.0.0.4">
<ns:ApplicationArea xmlns:ns="http://www.openapplications.org/oagis/9">
<ns:CreationDateTime/>
</ns:ApplicationArea>
</mem:ProcessPerson>
</soap:Body>
</soap:Envelope>
0 x

Steve
Moderator
Moderator
Posts: 421
Joined: Fri Sep 07, 2007 3:44 pm
Location: Sandy, UK
Contact:

#7

Postby Steve » Fri Dec 13, 2013 9:21 am

Hi

I think that you could be missing the mappings from your resource to the form.

Could you export your form (Tools-->Migration-->Export) and and the associated parts and zip them in an email to support@ebasetech.com

Note: the export xml file will be located in the following directory:

<ebase-install-dir>/UfsServer/transport

I will take a look and see if I can resolve the problem for you.

Kind regards

Steve Upton
0 x

Steve
Moderator
Moderator
Posts: 421
Joined: Fri Sep 07, 2007 3:44 pm
Location: Sandy, UK
Contact:

#8

Postby Steve » Fri Dec 13, 2013 3:17 pm

Hi

If you remove the default values from the table column fields and run the form again.

Click add row and type you values into the form manually.

Then click the button to call the web service. The table values are now copied into the resource and the document looks correct.

I hope this helps

Steve
0 x

Hurtz
Ebase User
Posts: 9
Joined: Thu Nov 28, 2013 1:53 pm
Location: Germany

#9

Postby Hurtz » Sat Dec 14, 2013 11:15 am

Thanks for the help this far. The hopefully last point I want to address is the fetchTable () procedure. I get the following snippet within the soap response:

<_wcf:UserData>
<_wcf:UserDataField name="identityTokenID">70145</_wcf:UserDataField>
<_wcf:UserDataField name="identityTokenSignature">IIJUYmrEuMO1IRNseWaKdP0/1Zg=</_wcf:UserDataField>
</_wcf:UserData>

The strings "identityTokenID" and "identity token signature" I can read from the table CREDENTIAL_USERDATA_USERDATAFIELD2 (column name57). However, I do not know where I can read the actual values. Naive as I am, I just tested the table PERSONALPROFILE_ATTRIBUTES2 because it has the column name58. This table, however, does not seem to be the right one.

My question is: where can I read the values &#8203;&#8203;(in my snippet "70145" and "IIJUYmrEuMO1IRNseWaKdP0/1Zg =")
0 x

Steve
Moderator
Moderator
Posts: 421
Joined: Fri Sep 07, 2007 3:44 pm
Location: Sandy, UK
Contact:

#10

Postby Steve » Mon Dec 16, 2013 9:46 am

Hi Sebastian,

You will need to fetchTable() on the Person table before you fetchTable() on the UserData.

This is a fairly complicated scenario. It might be best to work though the example to fully understand nest tables, or there might be enough information for you to understand here:

http://dev-docs.verj.io/ufs/doc/xmlreso ... torial_1_-

This example will show you how to work with nested tables.

Kind regards

Steve
0 x


Who is online

Users browsing this forum: No registered users and 24 guests