cancel
Showing results for 
Search instead for 
Did you mean: 

getting IUser objects in JSON format

Former Member
0 Kudos

hi,

in my application, i get IUser or IInfoObjects by query. after that i need to convert them JSON format to store them in MongoDB but i always get mapping and stackoverflow error. is there any way to convert them to JSON or getting them directly in JSON format?

my application should work for both BO 3.x and 4.x versions...

thanks...

Accepted Solutions (1)

Accepted Solutions (1)

DellSC
Active Contributor
0 Kudos

Part of the problem you may have is that not all IInfoObject objects have the same properties and there can be lots of nested properties.  So I'm not sure that there's a direct way to "serialize" an IInfoObject into JSON.  I'm sure someone here will correct me if I'm wrong, but you may have to write your own code that will convert the various types of IInfoObject into JSON "manually".

Also, there are new properties and object types in 4.x that aren't available in 3.x, so you would have to take that into account when writing your code.

-Dell

Former Member
0 Kudos

hi,

yes, the problem comes from nested objects. parent property has infinite nested objects. what i need is either get data without parent property or json formatted data.

which versions has restful api, do you know that?

only way i can find is mapping data manually. do you have any other idea?

DellSC
Active Contributor
0 Kudos

BI 4.x has RESTful web services.  However, it doesn't provide access to user objects, just to reports at this point.

I would determine which properties you want from IUser and instead of doing "Select *" to get the user objects, select the specific properties that you want.  This should limit the level of nesting in the returned object.

-Dell

Former Member
0 Kudos

thanks for the answer but this doesnt work because i tried to select just id column and it fills m_props column inifintely as well. i make mapping manually now, thats the only option for me.

Answers (1)

Answers (1)

Former Member
0 Kudos

there is "m_props" property inside IUser object. it has infinite tree, i guess this cause stackoverflow error while formatting JSON. is there anyone knowing to remove or making null this property?