Jump to content


< Back to Forum


 

Web Service Rv


  • Please log in to reply

#1 ahmed.muneer 29 November 2017 - 02:40 AM

Dear VG team,

 

i have used WBS recently and am getting connection with my server and returning back the data like in the below as shown in Vgengine.txt

 

 
<string xmlns="http://192.168.1.199/">&lt;NewDataSet&gt;
  &lt;Table1&gt;
    &lt;Result&gt;No Records&lt;/Result&gt;
  &lt;/Table1&gt;
&lt;/NewDataSet&gt;</string>
174748.786  23  10   3       xml   XmlNodeType.XmlDeclaration=<version="1.0" encoding="utf-8">
174748.787  23  10   3       xml   element atribs=1 name=string
174748.787  23  10   3       rvns  add   Ws_ValidateTid_string_xmlns|http://192.168.1.199/
174748.787  23  10   3       rvns  add   string_xmlns|http://192.168.1.199/
174748.787  23  10   3       rvns  add   string_xmlns|http://192.168.1.199/
174748.787  23  10   3       xml   text  path_parent=[] path_full=[string] localname=[] name=[] val=<NewDataSet>
  <Table1>
    <Result>No Records</Result>
  </Table1>
</NewDataSet>
174748.787  23  10   3       rvns  add   string|<NewDataSet>
  <Table1>
    <Result>No Records</Result>
  </Table1>
</NewDataSet>
174748.788  23  10   3       rvns  add   Ws_ValidateTid_string|<NewDataSet>
  <Table1>
    <Result>No Records</Result>
  </Table1>
</NewDataSet>
174748.788  23  10   3       rvns  add   string|<NewDataSet>
  <Table1>
    <Result>No Records</Result>
  </Table1>
</NewDataSet>
174748.788  23  10   3       rv    add   Ws_ValidateTid_http_resp_hdr_Connection|close
174748.788  23  10   3       rv    add   Ws_ValidateTid_http_resp_hdr_Content-Length|208
174748.788  23  10   3       rv    add   Ws_ValidateTid_http_resp_hdr_Cache-Control|private
174748.788  23  10   3       rv    add   Ws_ValidateTid_http_resp_hdr_Cache-Control_1|max-age=0
174748.789  23  10   3       rv    add   Ws_ValidateTid_http_resp_hdr_Content-Type|text/xml; charset=utf-8
174748.789  23  10   3       rv    add   Ws_ValidateTid_http_resp_hdr_Date|Tue, 28 Nov 2017 14:47:47 GMT
174748.789  23  10   3       rv    add   Ws_ValidateTid_http_resp_hdr_Server|Microsoft-IIS/8.5
174748.789  23  10   3       rv    add   Ws_ValidateTid_http_resp_hdr_X-AspNet-Version|4.0.30319
174748.789  23  10   3       rv    add   Ws_ValidateTid_http_resp_hdr_X-Powered-By|ASP.NET
174748.790  23  10   3       rvns  add   Ws_ValidateTid_Result_Data|<?xml version="1.0" encoding="utf-8"?><string xmlns="http://192.168.1.199/">&lt;NewDataSet&gt;  &lt;Table1&gt;    &lt;Result&gt;No Records&lt;/Result&gt;  &lt;/Table1&gt;&lt;/NewDataSet&gt;</string>
174748.790  23  10   3       rvns  add   Ws_ValidateTid_Result_Data_QE_Doubled|<?xml version=""1.0"" encoding=""utf-8""?><string xmlns=""http://192.168.1.199/"">&lt;NewDataSet&gt;  &lt;Table1&gt;    &lt;Result&gt;No Records&lt;/Result&gt;  &lt;/Table1&gt;&lt;/NewDataSet&gt;</string>
174748.790  23  10   3       rvns  add   Ws_ValidateTid_Result_Data_QE_Backslash|<?xml version=\"1.0\" encoding=\"utf-8\"?><string xmlns=\"http://192.168.1.199/\">&lt;NewDataSet&gt;  &lt;Table1&gt;    &lt;Result&gt;No Records&lt;/Result&gt;  &lt;/Table1&gt;&lt;/NewDataSet&gt;</string>
174748.790  23  10   3       rv    add   Ws_ValidateTid_Result_Code|OK
174748.791  23  10   3       rv    add   Ws_ValidateTid_Result_Desc|OK
174748.791  23  10   3       ws    GetWsResponse_Callback iRunWait=1, WavPlayWasStarted=0, WavPlayHasNowFinished=1
174748.791  23  10   3       ws    modCurrentModuleWs.hash=31884011 this.hash=31884011
174748.791  23  10   3       ws    modCurrentModuleWs == this. set modCurrentModuleWs=null and free reference
174748.791  23  10   3       ModuleCompleted_WebServiceCall [200] : [OK]
174748.791  23  10   3       path {200} not found
174748.791  23  10   3       path {OK} not found
174748.791  23  10   3       path {<?xml version="1.0" encoding="utf-8"?>
<string xmlns="http://192.168.1.199/">&lt;NewDataSet&gt;
  &lt;Table1&gt;
    &lt;Result&gt;No Records&lt;/Result&gt;
  &lt;/Table1&gt;
&lt;/NewDataSet&gt;</string>} not found
174748.792  23  10   3       path {OK} not found
174748.792  23  10   3       FindNextVgmTitleInPathList: next module title is=[Transfer to Agent_En]
174748.792  23  10   3       RunModule_AddToTaskQueue [Transfer Call,[Transfer to Agent_En],5]
174748.792  23  10   3       q_scr +     evScriptEvent 9800 CMD_RUN_SAME_MODULE_AGAIN
174748.792   9  10   3       q_scr run   evScriptEvent sCode=[CMD_RUN_SAME_MODULE_AGAIN] iActionID=0, crn=0 [0|0|0|0|0][|||||] 00:00:00 max:2|00:00:00.2200126
174748.792   9  10   3       se    CMD_RUN_SAME_MODULE_AGAIN 9800  0|0|0  || LineState=LS_WS_CALL
174748.792   9  10   3 t     timer clear (force=False)
174748.793   9  10   3       RunModule start
174748.793   9  10   3       RunModule start Transfer Call, [Transfer to Agent_En], iModuleIdx=5, previous: vgm=5, vgs=1:1
174748.793   9  10   3 state [Transfer to Agent_En] Monitored Dial and Connect to 7003@192.168.1.5
174748.793   9  10   3 t     timer set   0 sec : EV_TIMEOUT_READYTOBEGINTRANSFER
174748.793   9  10   3       q_scr +     evScriptEvent 9012 EV_TIMEOUT_READYTOBEGINTRANSFER
174748.793   9  10   3       RunModule finish
174748.793   9  10   3       q_scr run   evScriptEvent sCode=[EV_TIMEOUT_READYTOBEGINTRANSFER] iActionID=0, crn=0 [0|0|0|0|0][|||||] 00:00:00 max:2|00:00:00.2200126
174748.793   9  10   3       se    EV_TIMEOUT_READYTOBEGINTRANSFER 9012  0|0|0  || LineState=LS_XFER_1_START
174748.794   9  10   3       LsXfer_1_Start : 9012(EV_TIMEOUT_READYTOBEGINTRANSFER),EV_TIMEOUT_READYTOBEGINTRANSFER,0,0,0,,,
174748.794   9  10   3       path {EV_TIMEOUT_READYTOBEGINTRANSFER} not found
174748.794   9  10   3       timeout on transfer attempt set by  VG.INI [PBX] AnnouncedTransfersMaxWaitTime (30 sec)
174748.794   9  10   3 t     timer set   30 sec : EV_TIMEOUT_ANNOUNCED_TRANSFER_ATTEMPT_TOOK_TOO_LONG
174748.794   9  10   3       dial  IvrDevState strCID=[], strDialoutOptions=[<CallerId>380@IVR</CallerId>]
174748.794   9  10   3       dial  sCidSentThisCall=380@IVR (extracted from strDialoutOptions)
174748.794   9  10   3       dial  sCidSentThisCall=[380@IVR] (post RV replace)
174748.794   9  10   3       dial  strDialoutOptions=[<CallerId>380@IVR</CallerId>] (post RV replace)
174748.794   9  10   3       outbound call announce message not defined. vgm=5 [Transfer to Agent_En]
174748.794   9  10   3       calling FindFreeLine
174748.794   9               Search for free ports in list [] src=XferDialAndConf
174748.794   9   3   1       dial  FindFreeLine: reserving - no list specified
174748.795   9  10   3       dial  found free dev=1 (iLid=10 => iLid_OutboundLeg= 3)
174748.795   9   3   1       rv    clear all
174748.795   9  10   3       dial  str2LineRecordToThisFile=[]
174748.795   9   3   1       rv    clear all
174748.795   9   3   1       Issue_MakeCall begin
174748.795   9   3   1       L1_set Dialing (iState=LS_NULL_AWAITINGCALLS)
174748.795   9   3   1       L2_set Setup_Dialing  (called from Issue_MakeCall)
174748.796   9   3   1       rvns  add   OutDial_Result|NOTCONTACTED
174748.796   9   3   1       ktTel_MakeCall_Enqueue([7003@192.168.1.5],CONNECT_IMMEDIATELY, 60,0,10,380@IVR,<calltype>DialAndConf</calltype><CallerId>380@IVR</CallerId>) call
174748.796   9   3   1       q_tel +     cmd_MakeCall 0 [] [0,10,60,0,0,0,0,0][380@IVR|<calltype>DialAndConf</calltype><CallerId>380@IVR</CallerId>|7003@192.168.1.5|CONNECT_IMMEDIATELY||||]
174748.796   9  10   3       moh file not specified
174748.796   9  10   3 t     timer set   3600 sec : EV_TIMEOUT_HANGUP
174748.796   9   3   1 t     timer set   3600 sec : EV_TIMEOUT_HANGUP
174748.796   9  10   3       sRvOutboundLeg=, strDialoutOptions=<CallerId>380@IVR</CallerId>
174748.796   9   3   1       waiting till outcome of outgoing call leg known, as CallProgressOption=CONNECT_IMMEDIATELY
174748.796  10   3   1       q_tel run   cmd_MakeCall 0 0 max:3|8
174748.798  10   3   1 ev    ktTel_Completion (genericEv) 10000 0,Completion_MakeCall, crn=8000001, 134217729,0,0,7003@192.168.1.5,380@IVR,<result>ok</result><crn>134217729</crn><crnx>8000001</crnx>
174748.798  10   3   1 WARN  ListEvents_Add clsCdrBag for crn 0x8000001 not found
174748.798  10   3   1       q_scr +     evktTelCompletion 0 Completion_MakeCall
174748.798   9   3   1       q_scr run   evktTelCompletion sCode=[Completion_MakeCall] iActionID=0, crn=0 [134217729|0|0|0|0][7003@192.168.1.5|380@IVR|<result>ok</result><crn>134217729</crn><crnx>8000001</crnx>|||] 00:00:00 max:2|00:00:00.2200126
174748.798   9   3   1       OnCompletion_ktTel_MakeCall sRet=[<result>ok</result><crn>134217729</crn><crnx>8000001</crnx>] sCidSentThisCall=[380@IVR]
174748.799   9   3   1       OnCompletion_ktTel_MakeCall set crn_CurrentMakeCallAttempt to: 8000001
174748.799  23  10   3       ws    GetResponse_Callback response completed
174748.799   9   3   1       OnCompletion_ktTel_MakeCall inc zStatsIvrCall_today zStatsIvrCall_window_current etc.
174748.799   9   3   1       OnCompletion_ktTel_MakeCall GlobalStuff.iNumberOutgoingCallMakeCallOk=17
174748.799   9   3   1 state [Transfer to Agent_En] out_leg 3 => 1 7003@192.168.1.5  .
174748.804  24   3   1 ev    CallState GCEV_DIALING, crn=8000001, iEvent=0 ,16,0,16, s1:, s2:, s3:]. build_date: 2017-08-15 14:12:42.36
174748.804  24   3   1       q_scr +     evCallState 0 GCEV_DIALING
174748.804   9   3   1       q_scr run   evCallState sCode=[GCEV_DIALING] iActionID=0, crn=8000001 [16|0|16|0|0][|||||] 00:00:00 max:2|00:00:00.2200126
174748.807   9   3   1       callstate crn_event=8000001 0|GCEV_DIALING state=16|Dialing calldirection=0 gcCallState=16 [||], ScriptState=LS_XFER_7_WAITOUTCOMEOUTGOINGCALL_DIALINGSIDE
174748.807   9   3   1       LineEvCallState L1_current=Dialing crn_event=8000001,ev=0,GCEV_DIALING,0, sParam1=
174748.807   9   3   1       LineEvCallState LINECALLSTATE_DIALING begin
174748.807   9   3   1 state [Transfer to Agent_En] out_leg 3 => 1 7003@192.168.1.5  ..
174748.807   9   3   1 t     timer set   120 sec : EV_TIMEOUT_AFTERDIALING_AWAIT
174748.809  24   3   1 ev    Dialogic 2133,GCEV_LISTEN, crn=0, 2133,0,0,,,
174748.809  24   3   1       q_scr +     evScriptEvent 2133 GCEV_LISTEN
174748.809   9   3   1       q_scr run   evScriptEvent sCode=[GCEV_LISTEN] iActionID=0, crn=0 [2133|0|0|0|0][|||||] 00:00:00 max:2|00:00:00.2200126
174748.810   9   3   1       se    GCEV_LISTEN 2133  2133|0|0  || LineState=LS_XFER_7_WAITOUTCOMEOUTGOINGCALL_DIALINGSIDE
174748.810   9   3   1       LsXfer_7_dc_WaitOutcomeOutgoingCall_OutLeg : 2133,GCEV_LISTEN,2133,0,0,,,
174748.810   9   3   1       LsXfer_7_dc_WaitOutcomeOutgoingCall_OutLeg pass event to InLeg. sCode=GCEV_LISTEN
174748.810   9  10   3       q_scr +     evScriptEvent 2133 OTHER_LEG_GCEV_LISTEN
174748.810   9  10   3       q_scr run   evScriptEvent sCode=[OTHER_LEG_GCEV_LISTEN] iActionID=0, crn=0 [2133|0|0|0|0][|||||] 00:00:00 max:2|00:00:00.2200126
174748.810   9  10   3       se    OTHER_LEG_GCEV_LISTEN 2133  2133|0|0  || LineState=LS_XFER_7_WAITOUTCOMEOUTGOINGCALL_REQUESTXFERSIDE
174748.810   9  10   3       LsXfer_7_dc_WaitOutcomeOutgoingCall_InLeg : [OTHER_LEG_GCEV_LISTEN], 2133(EV_UNKNOWN_2133),2133,0,0,,,), xferType=32, leg2=3
174748.810   9  10   3       x7_dc_in before XFER_ANN_ACCEPTED test. sCode=OTHER_LEG_GCEV_LISTEN
174748.811   9  10   3       path {OTHER_LEG_GCEV_LISTEN} not found
174756.544  24  25   8 ev    PlayEnd 25 915975 [bytes_played=0:0, bytes_in_file=134819]
174756.544  24  25   8       play  end   id=915975 (current id)
174756.544  24  25   8       rvns  add   Play_REF_D_SoundFileLength|16852
174756.545  24  25   8       q_scr +     evScriptEvent 8001 EV_PLAY_FINISHED
174756.545   9  25   8       q_scr run   evScriptEvent sCode=[EV_PLAY_FINISHED] iActionID=0, crn=0 [915975|0|0|0|0][|||||] 00:00:00 max:2|00:00:00.2200126
174756.545   9  25   8       se    EV_PLAY_FINISHED 8001  915975|0|0  || LineState=LS_SAYNBRS_PLAY
174756.545   9  25   8       play  end   id=915975, current id=0 - passing event up (in secai)
174756.545   9  25   8       LsSayNbrPlay EV_PLAY_FINISHED,EV_PLAY_FINISHED
174756.545   9  25   8       path {EV_PLAY_FINISHED} not found
174756.545   9  25   8       iCurrReplayCount=0, iMaxReplayCount=1
174756.546   9               vgm 35_Play_REF_D   iReplayCount=1, iInterReplayPause=5
174756.546   9  25   8 t     timer set   5 sec : EV_TIMEOUT_REPLAYMSG
174757.686  24  25   8 ev    dtmf 2   (134217736,50,16) iConferenceOtherLegLid=-1, iConferenceOtherLegIvrDevPort=0
174757.686  24  25   8       q_scr +     evScriptEvent 50 2
174757.686   9  25   8       q_scr run   evScriptEvent sCode=[2] iActionID=0, crn=0 [0|0|0|0|0][|||||] 00:00:00 max:2|00:00:00.2200126
174757.686   9  25   8       se    2 50  0|0|0  || LineState=LS_SAYNBRS_PLAY
174757.687   9  25   8       LsSayNbrPlay 2,2
174757.687   9  25   8       path {2} found (at offset 40)
174757.687   9  25   8       FindNextVgmTitleInPathList: next module title is=[Send Email_Ar]
174757.687   9  25   8       q_tel +     cmd_PlayStop [0,0,0,0,0][||||]
174757.687   9  25   8       play  PlaySoundStop ok
174757.687   9  25   8       rv    add   Play_REF_D|2
174757.687   9  25   8 t     timer clear (force=False)
174757.688   9  25   8       RunModule start
174757.688   9  25   8       RunModule start Send Email, [Send Email_Ar], iModuleIdx=39, previous: vgm=35, vgs=1:1
174757.688   9  25   8 state [Send Email_Ar] Send Email
174757.688   9  25   8       rv    replace start [IVR DATA  REF: $RV[TVar] ,  $RV_DD/$RV_MM/20$RV_YY_$RV_HH:$RV_NN]
174757.688   9  25   8       rv    replace end   [IVR DATA  REF: 1042240 ,  28/11/2017_17:47]
174757.688   9  25   8       rv    replace start 
------------------------------
IVR DATA  

what am lookiong for is how can i get the data and compare in the vgs design file , i have done it on evaluate expression but i think am defining wrong RV.



#2 ahmed.muneer 29 November 2017 - 07:14 AM

Please note that i have  manipulated the below data from my server to VG server as the below xml format , then i want to have this RV name which is holding this data then i will have  in evaluate expression to validate as true or false.

 

<Result>No Records</Result>



#3 SupportTeam 29 November 2017 - 10:24 AM

Currently your web service returns this:

<string xmlns="http://192.168.1.199/">&lt;NewDataSet&gt;
&lt;Table1&gt;
&lt;Result&gt;No Records&lt;/Result&gt;
&lt;/Table1&gt;
&lt;/NewDataSet&gt;</string>

You should make it return this:

<string xmlns="http://192.168.1.199/"><NewDataSet>
<Table1>
<Result>No Records</Result>
</Table1>
</NewDataSet></string>

ie. You need to make it return proper XML (or JSON).

 

What is currently returned between the <string xmlns="http://192.168.1.199/"> and </string> tags is not XML - so it is not getting parsed.

 

(the &lt; and &gt; are not regarded as XML tag delimiters. Your web service is returning a single string, between the <string xmlns="http://192.168.1.199/"> and </string> tags).

 

 

You could still work with what is currently returned. To test if 'NoRecords' is returned in the 'Result' field you can use an Evaluate Expression module to run this test:

InStr("$RV[Ws_ValidateTid_string]", "&lt;Result&gt;No Records&lt;") > 0

True path will be taken if string is found, False path will be taken if string is not found.

 

But getting the web service to return proper XML (or JSON) is better approach. You will need this if some records are returned and you want to easily use the individual returned data as $RVs.



#4 ahmed.muneer 29 November 2017 - 04:40 PM

Dear Vg team,

many thanks for our response, but kindly note the below function did n't work with me, please find the attached logs.

 

i have changed the module name to WsValidateTid as well i did it in the EX module then i returned it back to Ws_ValidateTid as well i did in the EX module

InStr("$RV[Ws_ValidateTid_string]", "&lt;Result&gt;No Records&lt;") > 0

Please Advise.



#5 SupportTeam 29 November 2017 - 05:12 PM

Please try using:

InStr("$RV[Ws_ValidateTid_string]", "<Result>No Records") > 0

Looks like VoiceGuide is converting the &lt; and &gt; tags into "<" and ">" respectively before saving the string into $RV.

As advised before: getting the web service to return proper XML (or JSON) is best approach.



#6 SupportTeam 29 November 2017 - 05:36 PM

Actually, try this one:

InStr("$RV[Ws_ValidateTid_Result_Data_QE_Doubled]", "&lt;Result&gt;No Records") > 0

Your $RV[Ws_ValidateTid_string] has newline characters in it which results in errors when Instr function is evaluated...

 

$RV[Ws_ValidateTid_Result_Data_QE_Doubled] holds this data with no newline characters:

 

<?xml version=""1.0"" encoding=""utf-8""?><string xmlns=""http://192.168.1.199/"">&lt;NewDataSet&gt;  &lt;Table1&gt;    &lt;Result&gt;No Records&lt;/Result&gt;  &lt;/Table1&gt;&lt;/NewDataSet&gt;</string>



#7 ahmed.muneer 29 November 2017 - 05:51 PM

but i tried to use  $RV[Ws_ValidateTid_string] to be sent to my email i received on the below format , see the attached image.

<NewDataSet>
  <Table1>
    <Result>No Records</Result>
  </Table1>
</NewDataSet>

  • Ws_data.png


#8 SupportTeam 29 November 2017 - 06:12 PM

but i tried to use  $RV[Ws_ValidateTid_string] to be sent to my email i received on the below format

 

Looks like VoiceGuide is converting the &lt; and &gt; tags into "<" and ">" respectively before saving the string into $RV.

 

What arrives from your web service is a string, not XML (a string wrapped in one XML tag).

 

As per last post, try using:

InStr("$RV[Ws_ValidateTid_Result_Data_QE_Doubled]", "&lt;Result&gt;No Records") > 0

but best if you get your web service to return all as XML.



#9 ahmed.muneer 29 November 2017 - 06:45 PM

Dear Vg team,

 

thank you and i have tried theb elow RV , it's working fine.

InStr("$RV[Ws_ValidateTid_Result_Data_QE_Doubled]", "&lt;Result&gt;No Records") > 0

I apprecaite to share with me which RV i can use when i return the data in XML format



#10 SupportTeam 29 November 2017 - 07:37 PM

I apprecaite to share with me which RV i can use when i return the data in XML format

 

The created $RVs will show in vgEngine trace.

 

It'll probably be:

 

$RV[Ws_ValidateTid_NewDataSet_Table1_Result]

 

and the Evaluate Expression would then be:

InStr("$RV[Ws_ValidateTid_NewDataSet_Table1_Result]", "No Records") > 0

but it depends on what is the structure of the returned XML (or JSON)



#11 ahmed.muneer 29 November 2017 - 07:39 PM

Thank you for this information