on 04-01-2015 8:03 PM
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...
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
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
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.