PureConnect

 View Only
Discussion Thread View
Expand all | Collapse all

asynchronous web service call using SOAP HTTP Request tool in handler

  • 1.  asynchronous web service call using SOAP HTTP Request tool in handler

    Posted 04-29-2019 23:27
    Hi All,

    is it possible to call the asynchronous web service using the SOAP HTTP Request tool. If we can do this pls tell me how we can do this and how to progress with the rest of the calll flow if we have some dependency on the response of that web service ?. Lets says i have GetCustomerInfo as asynchronous web service and i need the response of that web service in my subsequent steps ..If its synchronous web service, i would have waited till  timeout occurs and based on that i would have  take decision.
    #Handlers

    ------------------------------
    Halesha Nagarajappa
    Accenture Solutions Pvt. Ltd.
    ------------------------------


  • 2.  RE: asynchronous web service call using SOAP HTTP Request tool in handler

    Posted 04-30-2019 08:19
    Are you saying you've got a web service that is asynchronous?  (IE:  you need to expose some sort of listener to get the response).  If so, I would recommend posting a lot more details about the webservice.  You can certainly expose a TCP port that you could pass to the web service and receive a response from - you'll probably spend a lot of time implementing the listener in handlers.  

    If, OTOH, you are wanting to know how to approximate C#'s async/await or Jave promises, simply create a second handler that responds to a custom notification.  Pass in everything you'll need via the custom data list, initiate the processing in that handler and then when you have completed everything in the first handler, you can wait for an attribute to be set on the call (you can use a timer loop for this, but I believe there is a toolstep that will just wait for an attribute to be changed - might be extended get key).  

    If you don't have a lot of processing to do, you can put the call on hold (remember you can specify a hold file to play) that either plays music or a message and then just make that message as long or longer than your web service timeout and you'll be fine.

    ------------------------------
    Jason Loucks
    Agon Consulting Services
    ------------------------------



  • 3.  RE: asynchronous web service call using SOAP HTTP Request tool in handler

    Posted 04-30-2019 08:49

    Hi Jason

     

    Thanks for the reply. Please let me know what more information you need on webservice ..Its soap based webservice and yes, your correct I got web service that is asynchronous.

    Cant we use SOAP HTTP Request tool step for this kind of webservice ? in that can we have request time out to say 8 seconds and while it waits for the 8 seconds ,can we play some fetch audio in background to customer informing "please wait while we fetch you data"

     

    Regards,

    Halesha sn

     




    This message is for the designated recipient only and may contain privileged, proprietary, or otherwise confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the e-mail by you is prohibited. Where allowed by local law, electronic communications with Accenture and its affiliates, including e-mail and instant messaging (including content), may be scanned by our systems for the purposes of information security and assessment of internal compliance with Accenture policy. Your privacy is important to us. Accenture uses your personal data only in compliance with data protection laws. For further information on how Accenture processes your personal data, please see our privacy statement at https://www.accenture.com/us-en/privacy-policy.
    ______________________________________________________________________________________

    www.accenture.com





  • 4.  RE: asynchronous web service call using SOAP HTTP Request tool in handler

    Posted 04-30-2019 09:49
    If you want to play hold music or audio during the timeout period, you need to use the custom notification tool to trigger a different handler to do so (creating another thread) and use the extended get key to flush the audio, so you can have it watch for an attribute change on the interaction from your original handler (after the timeout has ended) telling it to stop playing audio and exit the handler.

    ------------------------------
    Aaron Lael
    State of Utah
    ------------------------------



  • 5.  RE: asynchronous web service call using SOAP HTTP Request tool in handler

    Posted 04-30-2019 10:19
    You can make and asynchronous, multi-threaded call using the custom notification tool and initiator.  This will spawn a new handler thread while the original call thread continues on.  Just pass the call ID as a string to the custom notification tool and convert the string back to a call ID from the initiator.   Use a call attribute in both threads (a set attribute in the SOAP thread and a get attribute in the call thread) to determine when the SOAP request is complete.

    ------------------------------
    Steve Owen
    Avtex
    ------------------------------



  • 6.  RE: asynchronous web service call using SOAP HTTP Request tool in handler

    Posted 04-30-2019 11:25
    Hi Steve
    Thanks for the reply 

    I am new to the interaction designer ..

    This is how I understood.

    Step 1: I will create the one subroutine, which is customer facing and plays the welcome message and some menu option.

               If customer selects the option 1 in the menu, I will use the Send Custom Notification tool to generate the custom event.

     
    Step 2: I will create new handler which is listening for the custom event(using Custom Notification Initiator)  generated in the subroutine in                    step1 and use the SOAP HTTP request tool call the GetCustomerInfo webservice.

              do I need to make any extra setting the SOAP HTTP request tool to make this as asynchronous or just normal setting same as                 synchronous webservice ?

    if the control comes out in success exit path of the  SOAP HTTP request tool, I will set the call attribute with response value from webservice and exit the handler  . If control comes out with any other exit path, like HTTP Error, Timeout, I will set call attribute as failure and exit the handler

     

    Step3: what I have to do while it is executing the step 2? Play  some audio file using play audio tool with audio file length greater than timeout value specified in SOAP HTTP Request ? . Informing the customer that ,we are fetching their details



    ------------------------------
    Halesha Nagarajappa
    Accenture Solutions Pvt. Ltd.
    ------------------------------



  • 7.  RE: asynchronous web service call using SOAP HTTP Request tool in handler

    Posted 04-30-2019 12:46
    My guess is that you do not need a asynchronous SOAP request.  Typically, I only do asynchronous calls in 1 of 2 situations - 1. If the SOAP request is not time sensitive - in other words, it is not pertinent to the caller continuing on in the IVR.   2. If the SOAP request takes a long time and I want the caller to continue on with the call.

    From what you have described, a synchronous SOAP request is probably fine.  Play a "please wait while I look that up" or similar prompt and then execute the web service.  You should be fine.

    ------------------------------
    Steve Owen
    Avtex
    ------------------------------



  • 8.  RE: asynchronous web service call using SOAP HTTP Request tool in handler

    Posted 04-30-2019 11:05
    Halesha,

    You mentioned putting the caller on hold while the web service executes. This is how I have done most of my SOAP requests. Sometimes my SOAP responses take a few seconds to come back (like making a payment for example) where I would put the caller on hold, execute the SOAP request, get the response, and then continue on. My concern with spawning the SOAP request off into its own handler stream is what happens if the SOAP response doesn't come back or is delayed past where you would use the data. I assume that you will make there request and then shortly after the request you will get to a spot in the IVR where you need to act upon the response. What would you do in this situation?

    Maybe I'm over complicating things, or don't understand the use case but doing this asynchronously would make me nervous. 

    Thanks,

    ------------------------------
    Mark Tatera
    ConvergeOne

    Opinions are my own and not the views of my employer. Any suggestions or programming changes I suggest come with no warranty and should be tried at your own risk.
    ------------------------------



  • 9.  RE: asynchronous web service call using SOAP HTTP Request tool in handler

    Posted 04-30-2019 12:33

    Hi Mark,

    Can you please explain little bit further on  how you place on call hold(which toll you will be using) and what will customer hear during that time.

    Your saying before exciting the SOAP HTTTP request tool step, Put a call on hold and play audio file which is longer than timeout value specified in the SOAP HTTP request right?

    In this case we should ideally set the maximum time out value around 10 seconds within which I expect the web service to provide the response. Right?.

     

    Regards

    Halesha sn






  • 10.  RE: asynchronous web service call using SOAP HTTP Request tool in handler

    Posted 04-30-2019 12:43

    Hi Mark,

     

    What you have explained is exactly my requirement. I  never used asynchronous webservice call anywhere in my IVR development projects till now. Looking for the best and simple way to do it

     

    Regards

    Halesha sn

     






  • 11.  RE: asynchronous web service call using SOAP HTTP Request tool in handler

    Posted 05-03-2019 09:59
    Halesha,

    It sounds like you are running the request synchronously though as you are holding up the execution of the handler until the SOAP request returns results. This is how I normally code all of my web service calls as most times I need to use the data returned by the web service immediately and error handling becomes real difficult if you start doing things asynchronously.

    As for how to write this handler I will tell you that logically it is not difficult to do this but some of the tool steps involved are quite in depth to configure. I can't simply walk you through it. I don't know how much experience you have coding in generally or specifically with handlers but using trial and error should work for you. 

    Thanks,

    ------------------------------
    Mark Tatera
    ConvergeOne

    Opinions are my own and not the views of my employer. Any suggestions or programming changes I suggest come with no warranty and should be tried at your own risk.
    ------------------------------



Need Help finding something?

Check out the Genesys Knowledge Network - your all-in-one access point for Genesys resources