PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → Webservices (WX19)
Webservices (WX19)
Iniciado por guest, 08,abr. 2015 18:31 - 5 respuestas
Publicado el 08,abril 2015 - 18:31
Hi,
Do I have to implement my database connection initialization code INSIDE every Webservice procedure OR is it OK to leave it at the project code (initializing...)?

Although I can see, with the help of trace, that the project code RUNs everytime I call a webservice, I am getting some strange results, specially when using HChangeDir with local HFSQL databases

Steven Sitas
Publicado el 08,abril 2015 - 18:52
Hi,

Well If you import a webservice you can acces it like any other procedure. You could use a webservice and no database as well.

I guess it is calling the ini code to initiate, maybe internally the imported webservice needs be initiated as well ? And that me be the reason why it runs it.?

Maybe other forum members know more about this?

I have made connections to webservices in the past and never included tthe connection to db

regards
Allard
Publicado el 08,abril 2015 - 19:07
Hi Allard,
Sorry for the confusion ...
This is a WEBService that I developed with WD 19.

So I am having trouble with MY code in MY webservice, in the webservice code.
Not in the code that calls the webservice

Steven Sitas
Publicado el 08,abril 2015 - 20:06
Hi Steven

most of the time, the "strange results" in a webservice come from the fact that the user running the webservice does not have the appropriate rights (in your case, the hchangedir may try to connect to a directory where this user has NO rights)

Best regards
Publicado el 09,abril 2015 - 11:11
Hi Fabrice,
thanks for the TIP.
I will change my testing to HFSQL, so I can bypass the hchangeDir rights problem.

Is it OK to initialize/open/connect to the database ONCE at the project code (of the WEBService) or should I do it at every webservice procedure ?

thanks again for your help

Steven Sitas
Publicado el 09,abril 2015 - 13:55
Hi steven

AFAIK, it is the standard way of coding for a webservice too... The project init code is run every time for a reason.

Best regards