I don't use model builder, but I think I can point you in the right direction. You need to add an output parameter to your model,
then do something along these lines:
Just noticed your other similar thread. The specified item was not found.
I don't see why not. When I create gp services for web applications, I generally use a single JSON string input and output which makes setting up parameter inputs and processing outputs easy. I don't see why messages would be any different. Just make sure you know your data. If you are stringifying large objects (including messages), you are going to see a lot of data going across the pipe.
Thank you for your answer. Maybe you could help me a little further. I use a little python script at the end of my model builder to return the data in json format like that:
FC_In = arcpy.GetParameterAsText(0)
feature_set = arcpy.FeatureSet()
In the client I call the GP Service with ajax and I have noticed that the response contains two members
messages: [ ],
results: [ ]
In the messages member I have the json data from my GP, but results is an empty array. Why does the results empty? Would not be better to pass the json data inside the results parameter instead of the messages parameter? How can I do that?
Retrieving data ...