Web Service Interaction Component

Status
Not open for further replies.

len@Arena

Forum User
Joined
Aug 4, 2009
Messages
11
Reaction score
0
I am trying to build a test application using VAD. If I use a user input component I can get the user’s input at a later stage by using the expression editor. I have managed to call a webservice using the web service Interaction component; however I cannot seem to locate the result of this call when using the expression editor. When debugging, I can see that the web service result is being returned correctly. Any ideas?
 
How are you reading the result of the web service? Do you mean that the expression editor is not showing you the Result property for the web services interaction component?
 
Correct, the expression editor does not show the result property of the web services interaction component, and if I type the web services interaction component name . Result, I get "error.semantic.ecmascript" in project$.CurrentErrorName$ when debugging.
 
You are trying to open the expression editor in a component that is AFTER the web services interaction, right? Is it into any other component, like Condition or so? Can you describe the callflow you're creating? If you can post the .flow file, that would help too...
 
In this simple callflow, a user input control (InpCmp) is used to get a number from the user. The value of this control is passed to a webservice Interaction control (WS). Once the webservice is called, a prompt playback control is played (prompt 2). The value of the webservice (WS) is assigned to a variable (websrv) through a variable assignment component. At this point the callflow crashes and the last prompt (prompt 3) is not played.

Upon debugging I can see that the webservice returns the correct value in WS.Result, however when I try using this result by assigning it into a variable, the script crashes and I get "error.semantic.ecmascript" in project$.CurrentErrorName$

Here's the callflow:



<?xml version="1.0" encoding="utf-8"?>
<File>
<Version>1.0</Version>
<Variables>
<ArrayOfVariable xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Variable>
<Name>websrv</Name>
<InitialValue>0</InitialValue>
<ShowScopeProperty>false</ShowScopeProperty>
<DebuggerVisible>true</DebuggerVisible>
</Variable>
</ArrayOfVariable>
</Variables>
<Flows>
<MainFlow>
<ns0:MainFlow x:Name="Main" DebugModeActive="False" Description="Callflow execution path." xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:ns0="clr-namespace:Innovatip.VAD.Classes.Components;Assembly=3CX Voice Application Designer, Version=1.0.0.15, Culture=neutral, PublicKeyToken=7cb95a1a133e706e">
<ns0:UserInputComponent IsValidDigit_9="True" MaxRetryCount="3" IsValidDigit_1="True" IsValidDigit_Pound="False" IsValidDigit_6="True" DebugModeActive="False" InterDigitTimeout="3" IsValidDigit_4="True" IsValidDigit_3="True" MaxDigits="15" MinDigits="3" InitialPromptList="&lt;?xml version=&quot;1.0&quot;?&gt;&#xD;&#xA;&lt;ArrayOfPrompt xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;&gt;&#xD;&#xA; &lt;Prompt xsi:type=&quot;AudioFilePrompt&quot;&gt;&#xD;&#xA; &lt;Name&gt;AudioFilePrompt2&lt;/Name&gt;&#xD;&#xA; &lt;AudioFileName&gt;welcome.wav&lt;/AudioFileName&gt;&#xD;&#xA; &lt;/Prompt&gt;&#xD;&#xA;&lt;/ArrayOfPrompt&gt;" IsValidDigit_Star="False" InvalidDigitPromptList="&lt;?xml version=&quot;1.0&quot;?&gt;&#xD;&#xA;&lt;ArrayOfPromptCollection xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;&gt;&#xD;&#xA; &lt;PromptCollection&gt;&#xD;&#xA; &lt;PromptList&gt;&amp;lt;?xml version=&quot;1.0&quot;?&amp;gt;&#xD;&#xA;&amp;lt;ArrayOfPrompt xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;&amp;gt;&#xD;&#xA; &amp;lt;Prompt xsi:type=&quot;AudioFilePrompt&quot;&amp;gt;&#xD;&#xA; &amp;lt;Name&amp;gt;AudioFilePrompt1&amp;lt;/Name&amp;gt;&#xD;&#xA; &amp;lt;AudioFileName&amp;gt;tryagain.wav&amp;lt;/AudioFileName&amp;gt;&#xD;&#xA; &amp;lt;/Prompt&amp;gt;&#xD;&#xA;&amp;lt;/ArrayOfPrompt&amp;gt;&lt;/PromptList&gt;&#xD;&#xA; &lt;MinTryCount&gt;1&lt;/MinTryCount&gt;&#xD;&#xA; &lt;Prompts&gt;&#xD;&#xA; &lt;Prompt xsi:type=&quot;AudioFilePrompt&quot;&gt;&#xD;&#xA; &lt;Name&gt;AudioFilePrompt1&lt;/Name&gt;&#xD;&#xA; &lt;AudioFileName&gt;tryagain.wav&lt;/AudioFileName&gt;&#xD;&#xA; &lt;/Prompt&gt;&#xD;&#xA; &lt;/Prompts&gt;&#xD;&#xA; &lt;/PromptCollection&gt;&#xD;&#xA;&lt;/ArrayOfPromptCollection&gt;" IsValidDigit_7="True" FirstDigitTimeout="5" IsValidDigit_5="True" IsValidDigit_8="True" x:Name="InpCmp" IsValidDigit_0="True" Grammar="" SubsequentPromptList="&lt;?xml version=&quot;1.0&quot;?&gt;&#xD;&#xA;&lt;ArrayOfPromptCollection xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot; /&gt; " AllowBargeIn="True" FinalDigitTimeout="2" TimeoutPromptList="&lt;?xml version=&quot;1.0&quot;?&gt;&#xD;&#xA;&lt;ArrayOfPromptCollection xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot; /&gt; " StopDigit="DigitPound" IsValidDigit_2="True">
<ns0:ComponentBranch x:Name="componentBranch1" DisplayedText="Valid Input" Description="Execution path when the specified branch is activated." DebugModeActive="False">
<ns0:WebServicesInteractionComponent x:Name="WS" WebServiceName="WebSrvc1" DebugModeActive="False" URI="http://srv1.internal/sampleWS/service.asmx" ParameterList="&lt;?xml version=&quot;1.0&quot;?&gt;&#xD;&#xA;&lt;ArrayOfParameter xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;&gt;&#xD;&#xA; &lt;Parameter&gt;&#xD;&#xA; &lt;Name&gt;username&lt;/Name&gt;&#xD;&#xA; &lt;Value&gt;&quot;usr1&quot;&lt;/Value&gt;&#xD;&#xA; &lt;/Parameter&gt;&#xD;&#xA; &lt;Parameter&gt;&#xD;&#xA; &lt;Name&gt;password&lt;/Name&gt;&#xD;&#xA; &lt;Value&gt;&quot;ivr&quot;&lt;/Value&gt;&#xD;&#xA; &lt;/Parameter&gt;&#xD;&#xA; &lt;Parameter&gt;&#xD;&#xA; &lt;Name&gt;data&lt;/Name&gt;&#xD;&#xA; &lt;Value&gt;InpCmp.Result&lt;/Value&gt;&#xD;&#xA; &lt;/Parameter&gt;&#xD;&#xA;&lt;/ArrayOfParameter&gt;" Timeout="30" />
</ns0:ComponentBranch>
<ns0:ComponentBranch x:Name="componentBranch2" DisplayedText="Invalid Input" Description="Execution path when the specified branch is activated." DebugModeActive="False">
<ns0:PromptPlaybackComponent x:Name="prompt1" PromptList="&lt;?xml version=&quot;1.0&quot;?&gt;&#xD;&#xA;&lt;ArrayOfPrompt xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;&gt;&#xD;&#xA; &lt;Prompt xsi:type=&quot;AudioFilePrompt&quot;&gt;&#xD;&#xA; &lt;Name&gt;AudioFilePrompt1&lt;/Name&gt;&#xD;&#xA; &lt;AudioFileName&gt;wrong.wav&lt;/AudioFileName&gt;&#xD;&#xA; &lt;/Prompt&gt;&#xD;&#xA;&lt;/ArrayOfPrompt&gt;" AllowBargeIn="True" DebugModeActive="False" />
</ns0:ComponentBranch>
</ns0:UserInputComponent>
<ns0:PromptPlaybackComponent x:Name="prompt2" PromptList="&lt;?xml version=&quot;1.0&quot;?&gt;&#xD;&#xA;&lt;ArrayOfPrompt xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;&gt;&#xD;&#xA; &lt;Prompt xsi:type=&quot;AudioFilePrompt&quot;&gt;&#xD;&#xA; &lt;Name&gt;AudioFilePrompt1&lt;/Name&gt;&#xD;&#xA; &lt;AudioFileName&gt;five.wav&lt;/AudioFileName&gt;&#xD;&#xA; &lt;/Prompt&gt;&#xD;&#xA;&lt;/ArrayOfPrompt&gt;" AllowBargeIn="True" DebugModeActive="False" />
<ns0:VariableAssignmentComponent Expression="WS.Result" VariableName="callflow$.websrv" x:Name="variableAssignmentComponent1" DebugModeActive="False" />
<ns0:PromptPlaybackComponent x:Name="prompt3" PromptList="&lt;?xml version=&quot;1.0&quot;?&gt;&#xD;&#xA;&lt;ArrayOfPrompt xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;&gt;&#xD;&#xA; &lt;Prompt xsi:type=&quot;AudioFilePrompt&quot;&gt;&#xD;&#xA; &lt;Name&gt;AudioFilePrompt1&lt;/Name&gt;&#xD;&#xA; &lt;AudioFileName&gt;five.wav&lt;/AudioFileName&gt;&#xD;&#xA; &lt;/Prompt&gt;&#xD;&#xA;&lt;/ArrayOfPrompt&gt;" AllowBargeIn="True" DebugModeActive="False" />
</ns0:MainFlow>
</MainFlow>
<ErrorHandlerFlow>
<ns0:ErrorHandlerFlow x:Name="Main" DebugModeActive="False" Description="Execution path when an error ocurrs." xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:ns0="clr-namespace:Innovatip.VAD.Classes.Components;Assembly=3CX Voice Application Designer, Version=1.0.0.15, Culture=neutral, PublicKeyToken=7cb95a1a133e706e">
<ns0:ErrorHandlerContainer x:Name="errorHandlerContainer1" DebugModeActive="False" />
</ns0:ErrorHandlerFlow>
</ErrorHandlerFlow>
<DisconnectHandlerFlow>
<ns0:DisconnectHandlerFlow x:Name="Main" DebugModeActive="False" Description="Execution path since the call gets disconnected." xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:ns0="clr-namespace:Innovatip.VAD.Classes.Components;Assembly=3CX Voice Application Designer, Version=1.0.0.15, Culture=neutral, PublicKeyToken=7cb95a1a133e706e" />
</DisconnectHandlerFlow>
</Flows>
</File>



Any help appreciated

Len
 
Hi Len,

I have been looking at your callflow, and the problem is that the web services interaction component is in a deeper scope (it's into the Valid Input branch), so it can only be seen inside that block or inside a deeper block.

You can solve this moving the variable assignment component just after the web services interaction component (inside the Valid Input branch). That way, you can assign the result to a callflow variable, and then see that result everywhere in the callflow. I'm attaching a picture showing the updated callflow.

Please, try it out and let me know.

Ernesto.
 

Attachments

  • Callflow.jpg
    Callflow.jpg
    173.2 KB · Views: 6,184
Hi Ernesto,
Just tried it and it works fine. Thanks for the tip

Len
 
Great to know!
Thanks.
 
My web-service can't wirk with this component, becouse of sending parameters not in XML.
Is there way to send parameters in XML?
 
Hi,

Current version posts parameters to the web service. There is no way to configure the format they are sent.

This feature will probably be added in next releases. A workarround until this is added could be using an External Code Execution component and create your WebService client as a .NET dll. Can you try this?
 
Thank you.
I found another, more simpler, workaround.

Another problem: my incoming call put into DR, where by pressing 2 i call another DR (VAD app).
When i call and press 2 there is silence and after 20-30 seconds call drop.
What it is may be?
 
use 7.1.7139 version
 
Found this workaround:
1. add extension with permanent redirection to DR which is VAD app
2. In my DR for 2 setup connection to this exension
 
Hi, we'll verify the behavior you reported.
May I ask what workarround did you find for the web service? That information may help other users too...
Thanks.
 
OK.
My web service can work with simple post form.
For acceptance of url i use mod_rewrite and make needed urls.
 
Status
Not open for further replies.