If you have questions or if you want to share your opinion about Aware IM post your message on this forum
#51781 by fjcortes
Tue Oct 08, 2019 5:54 pm
Hi Jaymer,
Again, I tried to use postman, but I think I don't understand how this tool works or I lack knowledge in the subject.
On the other hand I created the structures and tried to send this information through this URL:
http: // localhost: 8080 / AwareIM / REST / pdv / sendme? PostedNY = 1 & response = {"response": [{"Qkey": "2000798-1"}, {"Qkey": "2000798-2", " Qans1 ":" 111 "}, {" Qkey ":" 2000798-4 "," Qans1 ":% 20" 222 "},% 20 {" Qkey ":" 2000798-5 "," Qans1 ":" 333 " , "Qans2": "serial_number"}, {"Qkey": "2000798-6", "Qans1": "444"}, {"Qkey": "2000798-7", "Qans1": "555"}, {"Qkey": "2000798-8", "Qans1": "666"}]} & theTime = "2019-10-08 12:00:00"

but it sends me an ERROR 400 when I put it in the browser, in postman it sends me a 500 error.
I think I will try to send the invoices one by one for a simple url.

Thank you for your invaluable help.
#51784 by Jaymer
Tue Oct 08, 2019 9:46 pm
You can’t send it through the URL like that.

Read this
https://stackoverflow.com/questions/389 ... ebservices

The question is not important, but the two replies show you how.
That should tell you how to get your JSON structure into postman.
Then you click post or send, and it will go to aware and you should get a response.
You should work back-and-forth like that until your JSON data is getting posted into the database.
After that, you can now go backwards to the phone part, or go forward to the aware processing part
#51787 by fjcortes
Tue Oct 08, 2019 11:32 pm
Following these instructions, it works on the structures, I created a procedure that receives the header structure as input and returns a BO with code 00 if it received data or code 01 if the structure is empty.
But .. I realized that the values of the attributes do not save them, I only create each of the records and the attributes leave them with a NULL value.
I did all this through postman
#51788 by Jaymer
Wed Oct 09, 2019 12:11 am
possibly related to your BOs - thats why up above I gave you pics of how the BOs needed to be to receive that JSON.

send me the exact JSON from Postman.
Send me pics of your header BO, and child BO (if you have it yet)

Its quite possible for Aware to receive the request, and apparently send you an OK response, but not write the data to the db if your BO structure is not perfect.
this is all the big "trick" to implementing REST. Aware implemented a "Discover" feature in 8.3, but it only works to an online service. So if you were calling a "real" service (ie. not just your custom phone app) THEN Aware could build the BOs to properly receive the JSON. But for now, a simple error in your BOs can make the data not get saved.
#51790 by fjcortes
Wed Oct 09, 2019 4:31 am
ok, since it is clear how the POST is done to AwareIM for uploading parent and child files. I had been delayed by the names of the attributes, because I did not take into account the capital letters, but once I made the corrections I charge and fill all the attributes correctly as seen in the image.

now thanks to postman, I can use the java code to load from the cell phone
thank you very much Jaymer, for so much patience and the knowledge provided
#51791 by Jaymer
Wed Oct 09, 2019 7:19 am

Ok so the names of the BOs don’t really matter. You can change to Rest_header & Rest_detail, for example.
You just change the Input BO on the Service Process to match your Header BO name.
You can add other JSON fields at the top level (not inside the [ .... ] child array) plus any other child fields (in the array) as long as you match field names.

No problem with having extra fields in Aware table that are not in the JSON.
But you’ll get an error If your incoming JSON specifies an incorrect field name. (the 500s you were getting)

Much easier, as you’re finding, to test with postman!
the major pain is that you have to publish after each little tweak.

Who is online

Users browsing this forum: MSN [Bot] and 10 guests