NetTalk Central

Author Topic: Changing the json results of a netwebservicemethod without using external name  (Read 2313 times)

JHojka

  • Jr. Member
  • **
  • Posts: 50
    • View Profile
    • Email
I have several tables that I need to change the way the json is created. I originally had used the external name of the table field to force the json to use upper and lower case. This worked great but, I have to convert these tables to the IPDriver which has proven to not like external names on any fields. Removing the external names fixes all my IPDriver problems but now my nettalk web service methods are not properly setup to translate the json. I found that reflection might be able to solve my issue. I have been able to use json.reflection.walk() to see what is being done with the json. I have been able to use json.reflection.rename() to change the reflection entry. I am not able to figure out where to put this code as I am not getting the results I would like. Nothing is actually getting renamed. I only see that I will need to make these translations on loading and saving of the table for gets as well as updates and adds.

from debugview

797   611.954211   7984   MSCClientWeb.exe   [3][rf]FIELD: GroupName=[MSCVERView] ColumnName=[MSCVER:VERSIONSEQUENCE] Num=[0] Type=[rf:NotSet] Rename=[VersionSequence] Pic=[] Attributes=[]


Any help would be appreciated on this.

JHojka

  • Jr. Member
  • **
  • Posts: 50
    • View Profile
    • Email
Fresh day with fresh results.  ;D. I used the name of the view 'MSCView' and not what I was shown in debugview++ 'View|1'. Once I changed this I saw the translation take place for my return results.

What worked is in BuildResultsFields at Priority 5000 I added code similar to the following.

        renameView = 'view|1'
        renameViewField = UPPER('MSCVER:VersionSequence')
        renameViewJson = 'VersionSequence'
        json.reflection.SetRename(renameView, renameViewField, renameViewJson)

Jeff