OK, so I created a Service and succesfully received the request url and sent back a list of courses that still had some availability. All Good - in fact easy peasy. Sample return below (sorry to anyone wanting to learn to glide - courses are full)
{
"response": [
{
"DurationDays": 5,
"PlacesAvailable": 0,
"CourseDate": "Mon, Sep 12, 2022",
"PlacesOnCourse": 6,
"CourseNumber": 8,
"WebSubject": "Public Course (double)"}
,
{
"DurationDays": 5,
"PlacesAvailable": 0,
"CourseDate": "Mon, Aug 8, 2022",
"PlacesOnCourse": 3,
"CourseNumber": 6,
"WebSubject": "Public Course"}
, ...........
So Now I want to allow a website visitor to book a place. I've got as far as creating the service, have a process that does a find supposdly based on an incoming url parameter - but I can't for the life of me get the syntax right. In the log it keeps finding all the courses (even though it returns only one)
So my code is FIND Courses WHERE Courses.CourseID=Courses.CourseID and I've tried ?Courses.CourseID, ?CourseID, ?Parameter and the URL is
http://localhost:8080/AwareIM/REST/XXXX ... CourseID=3
Logviewer shows me that 8 items are being found so CourseID=3 is not being picked up and fed into the FIND in the process. The rest of the process works as I do get a single return. So I'm stumped. How do you construct the FIND to receive the url input?
<WebCourses>
<DurationDays/>
<PlacesAvailable/>
<CourseDate/>
<PlacesOnCourse/>
<CourseNumber/>
<WebSubject>Booked</WebSubject>
</WebCourses>
Exposing REST Question
Exposing REST Question
Rocketman
V8.7 Developer Edition. Server 2016 Standard edition. MySql 5.5
V8.7 Developer Edition. Server 2016 Standard edition. MySql 5.5
Re: Exposing REST Question
knee bone connected to the leg bone,
leg bone connected to the shin bone,
shin bone connected to the ankle bone.
leg bone connected to the shin bone,
shin bone connected to the ankle bone.
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: Exposing REST Question
Incoming service (CourseBook) connected to process (web_CourseBook)
process has Input BO (REST_CourseBook)
input BO (REST_CourseBook, not persisted) has fields for aware to store the passed-in parameters
So the process gets called by the incoming request,
the process has access to the parms,
to then do: FIND Courses WHERE Courses.CourseID = REST_CourseBook.CourseID
which aligns with this URL:
process has Input BO (REST_CourseBook)
input BO (REST_CourseBook, not persisted) has fields for aware to store the passed-in parameters
So the process gets called by the incoming request,
the process has access to the parms,
to then do: FIND Courses WHERE Courses.CourseID = REST_CourseBook.CourseID
which aligns with this URL:
Code: Select all
http://localhost:8080/AwareIM/REST/XXXX/CourseBook?CourseID=3
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: Exposing REST Question
Ttttttttttttttsssssssssssssss - Boooom.
Every one a winner - every egg a bird.
Thanks @jaymer Now off to conquer the world (well ok - maybe tomorrow)
<WebCourses>
<DurationDays/>
<PlacesAvailable/>
<CourseDate>Mon, Aug 1, 2022</CourseDate>
<PlacesOnCourse/>
<CourseNumber>5</CourseNumber>
<WebSubject>Full</WebSubject>
</WebCourses>
Every one a winner - every egg a bird.
Thanks @jaymer Now off to conquer the world (well ok - maybe tomorrow)
<WebCourses>
<DurationDays/>
<PlacesAvailable/>
<CourseDate>Mon, Aug 1, 2022</CourseDate>
<PlacesOnCourse/>
<CourseNumber>5</CourseNumber>
<WebSubject>Full</WebSubject>
</WebCourses>
Rocketman
V8.7 Developer Edition. Server 2016 Standard edition. MySql 5.5
V8.7 Developer Edition. Server 2016 Standard edition. MySql 5.5