Home > database >  Webservice repeatedly call release and server resources performance
Webservice repeatedly call release and server resources performance

Time:10-10

Repeated calls a function in the form, function is used to invoke a web service interface, this function is placed in a custom class,
The SoapConnection lsc_con
Webserviceterminalcallsoap lws_tcall
Long llVar
String ls_result

Lsc_con=create the SoapConnection;
LlVar=lsc_con. CreateInstance (lws_tcall, "webservicetest")
Tns__struct lstr_tns_struct

Lstr_tns_struct. Info=info
Lstr_tns_struct. Macs=macs
Try
Ls_result=lws_tcall. Call (info, macs)
//Invoke service
The catch (SoapException e)
Messagebox (" Err ", "always invoke a Web service")
//error handling for
End the try

If ls_result='Call Success then
Return 0
The else
Return 1
End the if

Destroy lsc_con
So every time lsc_con and create will not lead to resources takes up too much, this will not lead to webservice server-side resource utilization is low, performance is affected, is it possible that a definition and create, repeated use of the good points,

CodePudding user response:

Recommend the use of PFW there httpclient object to invoke the HTTP HTTPS webservice sure there are a bunch of kit

CodePudding user response:

reference 1st floor qqhXh response:
recommended PFW with httpclient object to invoke the HTTP HTTPS webservice sure there are a bunch of kit

Can use does not need to separate out the entire framework

CodePudding user response:

Iws_tcall said in a statement the instance variables, it can be in a form the initialization or OPEN event, creating iws_tcall this object, destroy the Close event;
So anywhere in the form, call is done with the object, not repeat created, destroyed;

CodePudding user response:

Iws_tcall said in a statement the instance variables, it can be in a form the initialization or OPEN event, creating iws_tcall this object, destroy the Close event;
So anywhere in the form, call is done with the object, not repeat created, destroyed;

CodePudding user response:

Not in theory, all of these are local variables, will be automatically released and also manual destructor, how much more you,

Webservice is the essential and bs, between different instance (session) is irrelevant, so even in ws statement into instance or global variable is invalid,

CodePudding user response:

PFW httpclient understanding once

CodePudding user response:

Recommend the use of PFW there httpclient object what do you mean
  • Related