VoiceGuide IVR Software Main Page
Jump to content

Long Time To Call Webservice

Recommended Posts

Hello,

 

In one script we are calling a WebService and getting the return.

this call is too slow.

 

is there another way to call a WebService that is faster?

 

The code that we are using is bellow.

 

 

 

 

set vg = CreateObject("vgServices.CommandLink")

Set soapClient = CreateObject("MSSOAP.SoapClient30")

soapClient.MSSoapInit("http://XXXXXXXXXXXXXX/WS/Functions.asmx?WSDL")

 

par1="$RV[CodAprovacao]"

par2="$RV[CodUsuario]"

par3="$RV[idlog]"

 

 

value = soapClient.ValidaInformacoes(par1,par2,par3)

set soapClient = Nothing

vg.RvSet $RV_LINEID, "value", value

 

 

value1 = split(value, "|")(0)

value2 = split(value, "|")(1)

value3 = split(value, "|")(2)

 

strResultVariables = "[ret]{" & value & "}[ret1]{" & value1 & "}[ret2]{" & value2 & "}[ret3]{" & value3 & "}"

strResultVariables = replace(strResultVariables, ",", "")

 

vg.Run_ResultReturn $RV_LINEID, strResultVariables

 

vg.Run_ResultReturn $RV_LINEID, "Success"

 

 

set vg = Nothing

 

 

 

 

Share this post


Link to post

You can insert some Admin_TraceLogAdd entries though out the script to gauge where the delays are.

 

See: http://www.voiceguide.com/vghelp/source/html/com_admin_tracelogadd.htm

 

Admin_TraceLogAdd will add a log entry to the vgEngine trace file. Looking at timestamps of the Admin_TraceLogAdd generated entries you will be able to see fast each portion of the script executes.

 

Most likely the delay is in getting a response from the WebService itself. But if you can post the vgEngine trace excerpt capturing the script being executed we can then better comment on what is going on.

 

suggest you ue code like this:

 

set vg = CreateObject("vgServices.CommandLink")

vg.Admin_TraceLogAdd($RV_LINEID, 0, "web service script started")

Set soapClient = CreateObject("MSSOAP.SoapClient30")

vg.Admin_TraceLogAdd($RV_LINEID, 0, "web service script soapClient object created")

soapClient.MSSoapInit("http://XXXXXXXXXXXXX...tions.asmx?WSDL")

vg.Admin_TraceLogAdd($RV_LINEID, 0, "web service script soapClient object initialised")


par1="$RV[CodAprovacao]"
par2="$RV[CodUsuario]"
par3="$RV[idlog]"

vg.Admin_TraceLogAdd($RV_LINEID, 0, "web service script soapClient object ValidaInformacoes call")

value = soapClient.ValidaInformacoes(par1,par2,par3)

vg.Admin_TraceLogAdd($RV_LINEID, 0, "web service script soapClient object ValidaInformacoes returned")

set soapClient = Nothing
vg.RvSet $RV_LINEID, "value", value


value1 = split(value, "|")(0)
value2 = split(value, "|")(1)
value3 = split(value, "|")(2)

strResultVariables = "[ret]{" & value & "}[ret1]{" & value1 & "}[ret2]{" & value2 & "}[ret3]{" & value3 & "}"
strResultVariables = replace(strResultVariables, ",", "")

vg.Run_ResultReturn $RV_LINEID, strResultVariables

set vg = Nothing

 

Please note that we removed the:

 

vg.Run_ResultReturn $RV_LINEID, "Success"

 

You should only call Run_ResultReturn once in your script. Calling it with a returned RV list already counts as as success.

Calling Run_ResultReturn again can adversely affect the VoiceGuide script the has resumed execution as soon as the first Run_ResultReturn was called.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×