Hi,
I am working with a Parent Object as the return object in a very straight forward GET Restful Service.
This Parent object contains an attribute of type String array with the name DataClasses.
This is what the JSON response should look like:
I have created the attribute DataClasses in the Parent Object and it points to the Child Object with a single String parameter of type Text.
See links below:
I usually use it this way when I have an array of Objects stored in the DataClasses attribute where the object has its own attributes and the REST knows where to write the values to based on the same attribute name, but in the case there is no name and only the the string values:
"Email addresses",
"Geographic locations",
"IP addresses",
The problem is it does not return any value to the DataClasses object and I sit with an empty table in my DB. The Service works fine for the Parent Object but not for the child object with the String array.
Please help
Thanks
Francois
Handling an array in Rest Service
Re: Handling an array in Rest Service
After reading this several times, I think I know what you’re saying. Not 100% certain. it would help to see an actual reply you are getting from the service.
It seems like you’ve done this before, but on this particular type of reply there isn’t the normal named pairs/elements or whatever the correct term is. I may not even be valid JSON In that reply.
I’m not sure what the volume is, or if speed is an issue, but you may need to just parse this yourself if it doesn’t conform to what aware is expecting.
I think anyone will be able to help more once we see a full reply posted here.
It seems like you’ve done this before, but on this particular type of reply there isn’t the normal named pairs/elements or whatever the correct term is. I may not even be valid JSON In that reply.
I’m not sure what the volume is, or if speed is an issue, but you may need to just parse this yourself if it doesn’t conform to what aware is expecting.
I think anyone will be able to help more once we see a full reply posted here.
Click Here to see a collection of my tips & hacks on this forum? Or search for "JaymerTip" in the search bar at the top.
Jaymer
Aware Programming & Consulting - Tampa FL
Jaymer
Aware Programming & Consulting - Tampa FL
Re: Handling an array in Rest Service
Hi thank you Jaymer, I figured it out.
I declared DataClasses as a primitive string value which gives me the return in the following format: string1^string2^string3 instead of creating an attribute DataClasses that points to an array of Objects.
Thank you for your reply.
Kind regards,
Francois
I declared DataClasses as a primitive string value which gives me the return in the following format: string1^string2^string3 instead of creating an attribute DataClasses that points to an array of Objects.
Thank you for your reply.
Kind regards,
Francois