VoiceGuide IVR Software Main Page
Jump to content

Using Webservice In Voiceguid Through Run Vbscript Module

Recommended Posts

Calling WebService method which accept three parameters and return one value.

--

this is the code i am using in VBScript module.

Set soapClient = CreateObject("MSSOAP.SoapClient30")

soapClient.MSSoapInit "http://10.10.40.10/mescoreservice/webservice.asmx?WSDL"

Dim sText

Set sText = soapClient.Loginuser(Ahmed,6648220,#1,#1)

set vg = CreateObject("vgServices.CommandLink")

vg.Run_ResultReturn $RV_LINEID, sText

set vg = Nothing

 

----Thanks for always replying the post.

0530_1050_vgEngine.txt

VBScript_Demo.vgs

Share this post


Link to post

i am getting an error..

please check the code and reply for the solution.

Dim sText

Set sText = soapClient.Loginuser(Ahmed,6648220,#1#)

set vg = CreateObject("vgServices.CommandLink")

vg.Run_ResultReturn $RV_LINEID, sText

set vg = Nothing

 

--check the trace file which i have attached in my previous post.

Share this post


Link to post

Trace shows that script was started and then VG waits for script to complete.

 

Would recommend that you add some Admin_TraceLogAdd entries to your script to be able to see what stages the script are taking a long to execute.

(see http://www.voiceguide.com/vghelp/source/html/com_admin_tracelogadd.htm )

 

Most likely it's the web service interaction.

 

 

 

 

105049.622  6   7   4 state [Run VB Webservice] type: Script_VBScript, iRunWait=1
105049.625  6   7   4       rv    replace start 
------------------------------
Set soapClient = CreateObject("MSSOAP.SoapClient30")
soapClient.MSSoapInit "http://10.10.40.10/mescoreservice/webservice.asmx?WSDL"
Dim sText
Set sText = soapClient.Loginuser(Ahmed,6648220,#1,#1)
set vg = CreateObject("vgServices.CommandLink")
vg.Run_ResultReturn $RV_LINEID, sText
set vg = Nothing
------------------------------
105049.627  6   7   4       rv    replace end   [set soapClient = CreateObject("MSSOAP.SoapClient30")
soapClient.MSSoapInit "http://10.10.40.10/mescoreservice/webservice.asmx?WSDL"
Dim sText
Set sText = soapClient.Loginuser(Ahmed,6648220,#1,#1)
set vg = CreateObject("vgServices.CommandLink")
vg.Run_ResultReturn 7, sText
set vg = Nothing]
105049.627  6   7   4       script will be ran from file: C:\Program Files\VoiceGuide\temp\vbs_7_1.vbs
105049.627  6   7   4       delete existing: C:\Program Files\VoiceGuide\temp\vbs_7_1.vbs
105049.631  6   7   4       current objVbsOrExeProcess=
105049.631  6   7   4       RunVBScriptFile [wscript][C:\Program Files\VoiceGuide\temp\vbs_7_1.vbs][] timeout=60 (vbsPath=C:\Program Files\VoiceGuide\temp), start (new Process)
105049.631  6   7   4       objVbsOrExeProcess.Start call
105049.685  6   7   4       RunVBScriptFile just started. Handle=12076, Id=5872, StartTime=5/30/2011 10:50:49 AM, HasExited=False
105049.686  6   7   4       VBScript started [C:\Program Files\VoiceGuide\temp\vbs_7_1.vbs], ProcessHandle=[12076], VbsOrExeProcess.WorkingSet=[86016]
105049.687  6   7   4       RunModule_Script_AfterScriptStarted start
105049.687  6   7   4       waiting. iRunWait=1 (process:12076)
105049.687  6   7   4 t     timer set   1 sec : EV_TIMEOUT_CHECKONSTATE
105050.665 22   7   4 timer EV_TIMEOUT_CHECKONSTATE

Share this post


Link to post

set vg = CreateObject("vgServices.CommandLink")

vg.Admin_TraceLogAdd 0, 0, "This trace was printed from an external VB Script"

set vg = Nothing

--------------------------

i have used this code but stilll the run VBScript module is waits to complete.... script wait for a result from the running webservice and stuck there.

here i am attaching the script and the trace file.

---

the webservice method will accepts three string parameters and it return one string parameter.

is the VBScript code which i am using is correct?

and i am storing the returned value in run_result variable...

----

I got succeeded why i tried to run the webservice through a .exe application and that .exe application will write the data in .txt file which will read by VG in the later module.

-- but this process of creating a .exe application and executing at the run time .. is becoming a big process so we decided to go for direct execution through VBScript.

kindly consider my case and reply as soon as possible, waitng.

0601_1555_vgEngine.txt

Script_WebService_Demo.vgs

Share this post


Link to post

Reply as soon as possible because the company were i am working they are testing all the modules of VOICE GUIDE... if we succeeded in them then only we will be going for VOICEGUIDE.. and the organization may take a decision in this month to go for the software or not..

Share this post


Link to post

To debug VBScripts you should place Run_ResultReturn calls throughout the VBScript.

 

Your current VBScript is:

 

Set soapClient = CreateObject("MSSOAP.SoapClient30")
soapClient.MSSoapInit "http://10.10.40.10/mescoreservice/webservice.asmx?WSDL"
Set node_list = soapClient.GLoginuser(Ahmed,6648220,#1#)
set soapClient = Nothing
set vg = CreateObject("vgServices.CommandLink")
vg.Run_ResultReturn $RV_LINEID, node_list 
vg.Admin_TraceLogAdd 0, 0, "This trace was printed from an VB Script"
set vg = Nothing

 

Suggest adding more Admin_TraceLogAdd calls, like this:

 

set vg = CreateObject("vgServices.CommandLink")
vg.Admin_TraceLogAdd 0, 0, "1"
Set soapClient = CreateObject("MSSOAP.SoapClient30")
vg.Admin_TraceLogAdd 0, 0, "2"
soapClient.MSSoapInit "http://10.10.40.10/mescoreservice/webservice.asmx?WSDL"
vg.Admin_TraceLogAdd 0, 0, "3"
Set node_list = soapClient.GLoginuser(Ahmed,6648220,#1#)
vg.Admin_TraceLogAdd 0, 0, "4"
set soapClient = Nothing
vg.Admin_TraceLogAdd 0, 0, "5"
vg.Run_ResultReturn $RV_LINEID, node_list 
vg.Admin_TraceLogAdd 0, 0, "6"
set vg = Nothing

 

And post the trace again.

Please .ZIP up any traces before posting them.

 

Have you ran your VBScript outside of VoiceGuide to see it it correctly connects with your Web Service?

Share this post


Link to post

The Admin_TraceLogAdd traces did not appear in the vgEngine trace. not sure why they did not. Can you please change the VBScript to:

 

set vg = CreateObject("vgServices.CommandLink")
vg.Admin_TraceLogAdd $RV_LINEID, 5, "1"
Set soapClient = CreateObject("MSSOAP.SoapClient30")
vg.Admin_TraceLogAdd $RV_LINEID, 5, "2"
soapClient.MSSoapInit "http://10.10.40.10/mescoreservice/webservice.asmx?WSDL"
vg.Admin_TraceLogAdd $RV_LINEID, 5, "3"
Set node_list = soapClient.GLoginuser(Ahmed,6648220,#1#)
vg.Admin_TraceLogAdd $RV_LINEID, 5, "4"
set soapClient = Nothing
vg.Admin_TraceLogAdd $RV_LINEID, 5, "5"
vg.Run_ResultReturn $RV_LINEID, node_list 
vg.Admin_TraceLogAdd $RV_LINEID, 5, "6"
set vg = Nothing

 

and post traces capturing the call again.

Share this post


Link to post

132704.870 6 7 4 scriptevent * 0|0|0 ||

132704.871 6 7 4 LsPlayMsgFinished *,*, [ ], [ ], []

132704.872 6 7 4 path {*} found (at offset 3)

132704.875 6 7 4 FindNextVgmTitleInPathList: next module title is=[Run VB Webservice]

132704.875 6 7 4 rv add [Play Welcome]{*}

132704.875 6 d added Play Welcome | * | ( 50 6c 61 79 20 57 65 6c 63 6f 6d 65 | 2a | 5) id=7

132704.875 6 d added Play Welcome | * | ( 50 6c 61 79 20 57 65 6c 63 6f 6d 65 | 2a | 13) id=7

132704.875 6 7 4 t timer clear (force=False)

132704.875 6 7 4 RunModule start Run VB Script, [Run VB Webservice], iModuleIdx=2, previous: vgm=1, vgs=1

132704.875 6 7 4 state [Run VB Webservice] type: Script_VBScript, iRunWait=1

132704.878 6 7 4 rv replace start

------------------------------

set vg = CreateObject("vgServices.CommandLink")

vg.Admin_TraceLogAdd $RV_LINEID, 5, "1"

Set soapClient = CreateObject("MSSOAP.SoapClient30")

vg.Admin_TraceLogAdd $RV_LINEID, 5, "2"

soapClient.MSSoapInit "http://10.10.40.10/mescoreservice/webservice.asmx?WSDL"

vg.Admin_TraceLogAdd $RV_LINEID, 5, "3"

Set node_list = soapClient.GLoginuser(Ahmed,6648220,#1#)

vg.Admin_TraceLogAdd $RV_LINEID, 5, "4"

set soapClient = Nothingvg.Admin_TraceLogAdd $RV_LINEID, 5, "5"

vg.Run_ResultReturn $RV_LINEID, node_list

vg.Admin_TraceLogAdd $RV_LINEID, 5, "6"

set vg = Nothing

------------------------------

132704.880 6 7 4 script will be ran from file: C:\Program Files\VoiceGuide\temp\vbs_7_1.vbs

132704.880 6 7 4 delete existing: C:\Program Files\VoiceGuide\temp\vbs_7_1.vbs

132704.884 6 7 4 current objVbsOrExeProcess=

132704.884 6 7 4 RunVBScriptFile [wscript][C:\Program Files\VoiceGuide\temp\vbs_7_1.vbs][] timeout=40 (vbsPath=C:\Program Files\VoiceGuide\temp), start (new Process)

132704.884 6 7 4 objVbsOrExeProcess.Start call

132704.893 6 7 4 RunVBScriptFile just started. Handle=12260, Id=4888, StartTime=6/2/2011 1:27:04 PM, HasExited=False

132704.894 6 7 4 VBScript started [C:\Program Files\VoiceGuide\temp\vbs_7_1.vbs], ProcessHandle=[12260], VbsOrExeProcess.WorkingSet=[81920]

132704.895 6 7 4 RunModule_Script_AfterScriptStarted start

132704.895 6 7 4 waiting. iRunWait=1 (process:12260)

132704.895 6 7 4 t timer set 1 sec : EV_TIMEOUT_CHECKONSTATE

132705.704 22 7 4 timer EV_TIMEOUT_CHECKONSTATE

132705.704 22 7 4 qScr add evScriptEvent 9007 EV_TIMEOUT_CHECKONSTATE

132705.704 6 7 4 qScr run evScriptEvent sCode=[EV_TIMEOUT_CHECKONSTATE] iActionID=0, crn=0[0|0|0|0|0][|||||]

132705.704 6 7 4 scriptevent EV_TIMEOUT_CHECKONSTATE 0|0|0 ||

132705.709 6 7 4 LsRunWaitTillFinished EV_TIMEOUT_CHECKONSTATE lCode2Str=EV_TIMEOUT_CHECKONSTATE

132705.710 6 7 4 Process.HasExited is false (awaiting process end or COM function call) handle=12260, id=4888, StartTime=6/2/2011 1:27:04 PM

132705.710 6 7 4 .ExitTime returned error.

132705.710 6 7 4 LsRunWaitTillFinished: process still running

132705.711 6 7 4 t timer set 1 sec : EV_TIMEOUT_CHECKONSTATE

 

and also check the attached documents

log.zip

Share this post


Link to post

discard my previous post.. this is a minor erro..

use this one

----------- here is the trace file snapshot

110236.556 6 7 4 state [Run VB Webservice] type: Script_VBScript, iRunWait=1

110236.559 6 7 4 rv replace start

------------------------------

set vg = CreateObject("vgServices.CommandLink")

vg.Admin_TraceLogAdd $RV_LINEID, 5, "1"

Set soapClient = CreateObject("MSSOAP.SoapClient30")

vg.Admin_TraceLogAdd $RV_LINEID, 5, "2"

soapClient.MSSoapInit "http://10.10.40.10/mescoreservice/webservice.asmx?WSDL"'>http://10.10.40.10/mescoreservice/webservice.asmx?WSDL"

vg.Admin_TraceLogAdd $RV_LINEID, 5, "3

"Set node_list = soapClient.GLoginuser(Ahmed,6648220,#1#)

vg.Admin_TraceLogAdd $RV_LINEID, 5, "4"

set soapClient = Nothing

vg.Admin_TraceLogAdd $RV_LINEID, 5, "5"

vg.Run_ResultReturn $RV_LINEID, node_list

vg.Admin_TraceLogAdd $RV_LINEID, 5, "6"

set vg = Nothing

------------------------------

110236.561 6 7 4 script will be ran from file: C:\Program Files\VoiceGuide\temp\vbs_7_1.vbs

110236.561 6 7 4 delete existing: C:\Program Files\VoiceGuide\temp\vbs_7_1.vbs

110236.565 6 7 4 current objVbsOrExeProcess=

110236.565 6 7 4 RunVBScriptFile [wscript][C:\Program Files\VoiceGuide\temp\vbs_7_1.vbs][] timeout=40 (vbsPath=C:\Program Files\VoiceGuide\temp), start (new Process)

110236.565 6 7 4 objVbsOrExeProcess.Start call

110236.574 6 7 4 RunVBScriptFile just started. Handle=12272, Id=5096, StartTime=6/4/2011 11:02:36 AM, HasExited=False

110236.575 6 7 4 VBScript started [C:\Program Files\VoiceGuide\temp\vbs_7_1.vbs], ProcessHandle=[12272], VbsOrExeProcess.WorkingSet=[86016]

110236.576 6 7 4 RunModule_Script_AfterScriptStarted start

110236.576 6 7 4 waiting. iRunWait=1 (process:12272)

110236.576 6 7 4 t timer set 1 sec : EV_TIMEOUT_CHECKONSTATE

---------------------------

here is my .vgs file script

Version=5.0

DefaultModuleDisplayHeight=

StartModule=Play Welcome

RunAtHangup=

StartWithoutAnswer=0

CtmAsiName=

 

[Play Welcome]

Type=Play

DispSize=69

Txt=Play a sound file, then await a response...

PlayFile1=C:\Program Files\VoiceGuide\Scripts\Motabei\wave files\welcome.wav

Replay=2,5

strTtsText=press star to continue

on {*} goto [Run VB Webservice]

 

Position=392,89

 

[Run VB Webservice]

Type=Run VB Script

DispSize=69

Txt=Run a VB Script.

VbsFileToRun=

VbsWait=1

VbScript=

set vg = CreateObject("vgServices.CommandLink")

vg.Admin_TraceLogAdd $RV_LINEID, 5, "1"

Set soapClient = CreateObject("MSSOAP.SoapClient30")

vg.Admin_TraceLogAdd $RV_LINEID, 5, "2"

soapClient.MSSoapInit "http://10.10.40.10/mescoreservice/webservice.asmx?WSDL"

vg.Admin_TraceLogAdd $RV_LINEID, 5, "3

"Set node_list = soapClient.GLoginuser(Ahmed,6648220,#1#)

vg.Admin_TraceLogAdd $RV_LINEID, 5, "4"

set soapClient = Nothing

vg.Admin_TraceLogAdd $RV_LINEID, 5, "5"

vg.Run_ResultReturn $RV_LINEID, node_list

vg.Admin_TraceLogAdd $RV_LINEID, 5, "6"

set vg = Nothing

VbsHoldPlay=

on {success} goto [Play Success]

on {fail} goto [Play Fail]

on {timeout 40} goto [Play TimeOut]

 

Position=396,199

 

[Play Success]

Type=Play

DispSize=69

Txt=Play a sound file, then await a response...

Replay=2,5

strTtsText=success, press star to get the number

on {*} goto [say Numbers Result]

 

Position=397,300

 

[Play Fail]

Type=Play

DispSize=69

Txt=Play a sound file, then await a response...

Replay=2,5

strTtsText=fail, press * to re try

on {*} goto [Play Welcome]

 

Position=224,309

 

[Hangup]

Type=Hangup the Call

DispSize=69

Txt=Hangup the call.

 

Position=407,505

 

[say Numbers Result]

Type=Say Numbers

DispSize=69

Txt=Say the number, amount, date or the digits. See the list o options to see how the number supplied can be interpreted and spoken out...

PlayFile2=$RV_LINEID

Replay=2,5

SayNbrType=Number

on {*} goto [Hangup]

 

Position=404,398

 

[Play TimeOut]

Type=Play

DispSize=69

Txt=Play a sound file, then await a response...

Replay=2,5

strTtsText=Time out, press * to continue

on {*} goto [Play Welcome]

 

Position=605,307

---

check for the attached documents

---------------------------

Support team,

you know the address of the webservice that you can access.

you know the method to call and what are the parameter it will accept.

if the passed parameteres matches in the database it will return 3 or else it will return 1.

So know i request the support team to run the Webservice using VBScript module in VOICE GUIDE and then post the solutions.

because this will better it will solve the problem in one single post.. rather than support team suggestin me then i will make the nesseccary changes and again postback in forum..

thanks for your support.. you can acces on the webservice as it is deployed on our server.

-----waiting for the reply.

log.zip

Share this post


Link to post

It appears that the web service is on your own local network (IP address 10.10.40.10), so outside users would not be able to immediately access it:

 

http://10.10.40.10/mescoreservice/webservice.asmx

 

 

Do simple VBScripts work when ran from VoiceGuide's Run VBScript module?

 

Have you tried running the Web Service script yourself? ie. not through VoiceGuide but just double clicking on a .VBS file yourself, or running it from command lin using wscript or cscript etc?

Share this post


Link to post

yes i have used that webservice .. several times in my projects.

Even i have used the same service in which i have called the same GLoginuser(Ahmed,6648220,#1#)function In VGS.

but there i have created a .exe file which will call to webservice and returns data in .txt file

again RUN Module will read the data from .exe file. but thiss process is very log ..

----

but when i am trying to use the Service and the same method. it raises in VGS using VBS Script module it waits.

---

Company is designing a compute system to interact with there customers. nearly they have 10 thousand customers for many several reasons,

bill payment,online problems, call center, help desk, etc ..

so it will be problem if we start the project using .exe files.. because every time we have to follow that big proceedure to interact with webservice.

thats why they tooked a decision to directly communicate with webservices using vbscript which is supported in VOICE GUIDe. but here we are facing the problem..... that you know...

So what should i do further to solve this problem.

Share this post


Link to post

-After working for a long time on VBScript module to call a webservice, I got the success.

I will post my script here so that will be helpful for others.

and also the trace files.

Share this post


Link to post

Here is the code to run a webservice in VBScript module

 

Set soapClient = CreateObject("MSSOAP.SoapClient30")

soapClient.MSSoapInit("http://localhost/mescoreservice/webservice.asmx?WSDL")

 

id=$RV[Get UserID]

password=$RV[Get password]

hash="#3#"

 

value = soapClient.IVR_LoginUser(id,password,hash)

set soapClient = Nothing

 

set vg = CreateObject("vgServices.CommandLink")

vg.RvSet $RV_LINEID, "value", value

 

If value = 1 Then

vg.Run_ResultReturn $RV_LINEID, "Success"

Else

vg.Run_ResultReturn $RV_LINEID, "fail"

End If

 

set vg = Nothing

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
×