Dismiss Notice
We would like to remind you that we’re updating our login process for all 3CX forums whereby you will be able to login with the same credentials you use for the Partner or Customer Portal. Click here to read more.

Web Service Interaction Component

Discussion in 'CRM / Helpdesk / App Integration' started by len@Arena, Aug 4, 2009.

Thread Status:
Not open for further replies.
  1. len@Arena

    Joined:
    Aug 4, 2009
    Messages:
    11
    Likes Received:
    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?
     
  2. edossantos

    edossantos Support Team
    Staff Member 3CX Support

    Joined:
    Jun 27, 2007
    Messages:
    1,597
    Likes Received:
    125
    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?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. len@Arena

    Joined:
    Aug 4, 2009
    Messages:
    11
    Likes Received:
    0
    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.
     
  4. edossantos

    edossantos Support Team
    Staff Member 3CX Support

    Joined:
    Jun 27, 2007
    Messages:
    1,597
    Likes Received:
    125
    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...
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. len@Arena

    Joined:
    Aug 4, 2009
    Messages:
    11
    Likes Received:
    0
    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
     
  6. edossantos

    edossantos Support Team
    Staff Member 3CX Support

    Joined:
    Jun 27, 2007
    Messages:
    1,597
    Likes Received:
    125
    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.
     

    Attached Files:

    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. len@Arena

    Joined:
    Aug 4, 2009
    Messages:
    11
    Likes Received:
    0
    Hi Ernesto,
    Just tried it and it works fine. Thanks for the tip

    Len
     
  8. edossantos

    edossantos Support Team
    Staff Member 3CX Support

    Joined:
    Jun 27, 2007
    Messages:
    1,597
    Likes Received:
    125
    Great to know!
    Thanks.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. elantech

    Joined:
    Jan 23, 2008
    Messages:
    20
    Likes Received:
    0
    My web-service can't wirk with this component, becouse of sending parameters not in XML.
    Is there way to send parameters in XML?
     
  10. VAD_Support

    VAD_Support Active Member

    Joined:
    Aug 6, 2009
    Messages:
    690
    Likes Received:
    0
    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?
     
  11. elantech

    Joined:
    Jan 23, 2008
    Messages:
    20
    Likes Received:
    0
    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?
     
  12. elantech

    Joined:
    Jan 23, 2008
    Messages:
    20
    Likes Received:
    0
    use 7.1.7139 version
     
  13. elantech

    Joined:
    Jan 23, 2008
    Messages:
    20
    Likes Received:
    0
    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
     
  14. VAD_Support

    VAD_Support Active Member

    Joined:
    Aug 6, 2009
    Messages:
    690
    Likes Received:
    0
    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.
     
  15. elantech

    Joined:
    Jan 23, 2008
    Messages:
    20
    Likes Received:
    0
    OK.
    My web service can work with simple post form.
    For acceptance of url i use mod_rewrite and make needed urls.
     
  16. VAD_Support

    VAD_Support Active Member

    Joined:
    Aug 6, 2009
    Messages:
    690
    Likes Received:
    0
Thread Status:
Not open for further replies.