Skip to main content
InSource Solutions

TN - 1374 Configuring the OI.WebSvc User Guide Example

Description

 

This article from InSource shows how to configure the OI-WEBSVC OI Server leveraging the Open Weather Map example outlined in the User Guide.

  • Author: Mario Meza
  • Published: 06/16/2023
  • Applies to: OI-WEBSVC G-2.1 (v1.0) and above

Details 83443

  If you've tried to configure the OI.WEBSVC you may notice it's not like the standard OI Servers. This OI Server is a little different in that it's designed to interact with a webservice, the counterpart to that being that the webservice must also be configured to respond to REST requests. These are in the form of GET/POST/PUT/DELETE requests for a REST connection. 

The WebSvc user guide and following Youtube video reference using Open Weather Map for testing the OI Server. If you've tried implementing this example you may have encountered connectivity issues, here are a couple things to be aware of in order to establish a connection using this example. 

If you copy and paste the URL's from the documentation you will be met with connection failure...

clipboard_e2e51b53f40c14395c386b7bfe869f01b.png

and 401 Unauthorized error code when testing the connection. 

clipboard_edc3b6bbd07fe3f7d61cfb96ee409db52.png

 This is because the Open Weather Map API authorizes requests by means of an  API Key , submitted as the  appid URL parameter, meaning that Instead of “11111” you must submit your own API Key which must be acquired from Open Weather Maps. 

To do this sign up for a freemium account which provides API access to open weather maps. There you can create an API KEY by selecting Generate under the API keys option.

clipboard_ecd8e0640cfe709dce57b25e5c878b62b.png

 

 Using the same string from the documentation but updating the fake appid of 1111111 with one of the API Keys you just generated from Open Weather Maps, should allow for a successful connection and return data from the Test connection.

clipboard_e55b2d1c145b6929eb76bdd65c5c8f5b8.png