Defining structure on REST with the Service Studio

Defining structure on REST with the Service Studio

  
Hi, Is it in someway possible to automaticaly define a structure on a REST WebAPI within the Service Studio.
In other words : I do have the JSON reponse output (and also an XML conversion of it) and would like to define a structure on the WebApi automatically instead of having to add all the structure attributes by hand.
Regards, Ronald Brink
Ronald,

I'm not sure what you mean. Are you consuming a REST API? In that case, you can paste the JSON into the "Response" in the Body tab of the consumed method, and Service Studio will create the necessary structures for you.
Kilian Hekhuis wrote:
Ronald,

I'm not sure what you mean. Are you consuming a REST API? In that case, you can paste the JSON into the "Response" in the Body tab of the consumed method, and Service Studio will create the necessary structures for you.
 Hi Kilian,
Thanks for your reply. Yes indeed I'm consuming a REST API via the TEST facility in the Service Studio.
However that API's response is a XML stream (not JSON). I did convert the XML stream to JSON format.
From your answer I understand that when the output is already JSON at response time and I then hit the "Copy to Response Body" button in the Service Studio then the structure is automatically generated for me.
Do I understand you correctly in this.
If so : Should this automatic generation also be working when I paste my own converted JSON string in the body part by hand?
Regards Ronald
 
Hi Ronald,

I'm not sure what you mean by the "test facility". What I'm saying is that Service Studio autogenerates the structures from the JSON you enter (or paste) in the Response input box.
Hi Kilian. Well that's what I finally did but after pasting nothing gets autogenerated at all.
Hi Ronald,

I've recorded a small video showing that Service Studio auto-generates structures. You can find it here.
Hi Kilian. That helped me out! Thanks a lot, it's working now!
Great to hear!