You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 10 Next »

Sometimes getting a taste of success is all that's need to charge ahead and make technology magic. Therefore, before diving in and creating new APIs, let's make sure that the default APIs are responding correctly to incoming requests.

Get Your Motor Runnin'

Before we get too eager to test our APIs, let's make sure we have the Engine Server running. Otherwise our testing will fail. If using a browser, this usually results in a connection time out page. If using an API test utility like Postman, you'll see a message like "Unable to connect to Engine Server localhost:8088 - The attempt to connect was forcefully rejected."

The 103-966 OpenInsight OEngineServer Configuration.pdf document provides thorough instructions for installing the Engine Server as a true Windows service as well as how to launch it from a command prompt (aka "debug" mode). We recommend starting out by running the Engine Server from a command prompt since developers will need access to the OpenInsight Debugger when writing and troubleshooting their web APIs.

It is possible to test the SRP HTTP Framework without having to go through the effort of creating any APIs. This will not guarantee that all possible configuration details have been properly updated, but at this point we just want to make sure that HTTP requests are getting received by the SRP HTTP Framework and a proper response is being sent back.

The quickest way to run a test is to enter your API URL into a browser and submit the request. For instance, if your Home URL is https://api.mysite.com and your API URL is /v1, then enter the following into your browser's address bar:

https://api.mysite.com/v1

This should immediately make contact with the OECGI and then OpenEngine. If you are running the Engine Server in the command line you will see an instance of OpenEngine running on the desktop. Otherwise, if you are running the Engine Server as a service, you will probably not see any OpenEngine activity.

The clearest indicator that the SRP HTTP Framework system is running is based on the response you get. If you enabled authentication in the HTTP Framework Setup form, the response should appear like this:

{
   "URL" : "https://api.mysite.com/v1/",
   "method" : "GET",
   "phrase" : "Unauthorized (RFC 7235)",
   "status" : 401
}

If authentication is disabled, the response should appear like this:

{
"_links": {
"item": [
{
"href": "https://api.mysite.com/v1/contacts",
"title": "contacts"
},
{
"href": "https://api.mysite.com/v1/version",
"title": "version"
}
],
"self": {
"href": "https://api.mysite.com/v1/"
}
}
}

Either of the above responses indicates that the API entry point was reached and processed accordingly. Congratulations! You are now ready to start building your own RESTful web services.

  • No labels