Page 1 of 1

Test RESTful web services

PostPosted: Wed Aug 09, 2023 11:00 am
by marco.rossi
Good morning,
does exist a way to test the web services into the servoy developer? https://wiki.servoy.com/display/DOCS/RE ... b+Services
Ex: by using an external client to create a get request and getting a response from the servoy developer in which I can put a breakpoint on the underneath code.

I see the admin page listens over the servoy developer port so I was wondering if the defined REST apis do as well.

Thanks
Marco

Re: Test RESTful web services

PostPosted: Wed Aug 09, 2023 11:17 am
by mboegem
marco.rossi wrote:does exist a way to test the web services into the servoy developer?

Can't you use Postman for that?

marco.rossi wrote:I see the admin page listens over the servoy developer port so I was wondering if the defined REST apis do as well.

Of course, it's just another solution

Re: Test RESTful web services

PostPosted: Thu Aug 10, 2023 11:53 am
by marco.rossi
Hi Marc,
thank you for your reply.

Can't you use Postman for that?

Yes, I am already using Postman to test the REST APIs when they are up and running on a real Tomcat server.

However, what I would like to do is test an API within the Servoy Developer for code testing purposes.
Let's assume that my local Servoy Developer installation is on port 8183, and I have a standalone Tomcat on which I load my war file on port 8383.

When I run my REST APIs on port 8383, everything works smoothly. I receive the expected response in Postman, complete with my custom message based on the processing performed.

The issue arises when I attempt to run the exact same GET request while switching to port 8183.
This is the port on which my developer should be listening since it is used for the admin page. In this case, I receive a 404 (not found) error.


Thank you once again for your assistance.

Best regards,
Marco

Re: Test RESTful web services

PostPosted: Thu Aug 10, 2023 12:11 pm
by mboegem
Hi Marco,

If the API solution is active in developer I don't see a reason why it shouldn't work.
I'm doing this all the time.

Are you sure you're using the correct URL?
A major difference could be that you are deploying your solution as 'rossi.war' this would need a URL like this:
Code: Select all
http://localhost:8383/rossi/servoy-service/rest_ws...........


Servoy developer always runs the solution in the tomcat ROOT, so the URL looks like this:
Code: Select all
http://localhost:8183/servoy-service/rest_ws...........


Hope this helps

Re: Test RESTful web services

PostPosted: Mon Aug 14, 2023 1:21 pm
by marco.rossi
Hi Marc,
thanks for the answer.

I didn't try it yet but I feel you're 100%, I probably just forgot to remove the subfolder when I call the developer :roll:

Thanks for the help!