Welcome! Log In Create A New Profile

Advanced

Rest Webservice WD23

Posted by cabinetman 
Rest Webservice WD23
January 11, 2019 02:44AM
Hello All,

Has any fiqured out how to use the new rest webservice in Windev23?

dw
pao
Re: Rest Webservice WD23
January 11, 2019 10:24AM
You will need the WEBDEV APPLICATION SERVER to deploy the REST webservice.

Your question is about making the rest webservice or use it?

Regards

Paulo Oliveira
Re: Rest Webservice WD23
January 11, 2019 07:14PM
Hello Paulo,

Yes I build it.

How is the connection to the DB handled? If you are building it to deploy in different locations the connection string will change can not be hard code it. So how would one handle this?

There are many more questions due to the fact the help is limited and there are no good examples out there.

Dennis W
robert willis
Re: Rest Webservice WD23
January 12, 2019 04:10AM
I have a similar situation where the web service would have to connect to different sources. I haven't done this in practice yet but I figure that I would have a central db to handle this. In some authentication token being passed to the service like a login, that login would consist of a token(GUID) and some other password, etc. That in turn would be passed to the authentication db. If successful, it would also pass back db credentials. Then do a change connection using these parameters.
pao
Re: Rest Webservice WD23
January 14, 2019 10:54AM
Dennis.
I don't know if this helps you but here is some basic explanation.

The DB connection is managed exactly as in any other windev/webdev application.
In our case we have aprox. 100 diferent dbs in our server.
We provide one token to each client and to use our werbservices they must send it as one webservice parameter, with the information of the token we can decide what the DB to use (in the project gobal code) and use hdescribeconnection/hopenconnection/hchangeconnection to use the desired DB.

Regards

Paulo Oliveira
Re: Rest Webservice WD23
January 14, 2019 01:33PM
Hello Paulo,

Where or how do you store the DB parameters? Do you send them with the token or store in a DB? Or store in Ini file?

DW
pao
Re: Rest Webservice WD23
January 14, 2019 01:49PM
I store the DB parameters in one INI file.

The information in the token have the name of the ini file to read in it.
For the token we use one GUID, the client number, the ini file to read and some other information.We encrypt the string with the information we need to generate the token and send it to our clients encoded in BASE64.

When they need to use the webservices they send the token as one wwbservice parameter. We decode, decrypt it and check if the information is valid.

Regards

Paulo Oliveira



Edited 2 time(s). Last edit at 01/14/2019 05:05PM by pao.
Re: Rest Webservice WD23
January 14, 2019 02:23PM
Hello Paulo,

Thank you for detailed explanation this is very helpful.

1 more question.

On the Ini file that is on your server how do you go about setting up the info you need in it?

Do you use a configuration web page? or do it through a Windev app?

Dennis
pao
Re: Rest Webservice WD23
January 14, 2019 03:05PM
We do it manually.
We don't sell online (our service isn't a typical cloud solution), before the use of the webservice we have to define a lot of parameters and costumization depending on the type of services contracted and only after that it's possible to use the webservices.

Our business is to provide HR solutions not only apps. We provide HR services and consultants as well, the app is only one part of the solution.

Regards

Paulo Oliveira
Re: Rest Webservice WD23
January 14, 2019 03:22PM
Paulo,

Once again thank you for your help. I will experiment with it now.

Dennis
Author:

Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: