cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
88
Views
0
Helpful
0
Comments
cdnadmin
Community Member
This document was generated from CDN thread

Created by: NEW USER on 17-07-2009 04:02:39 PM
Hi,
 
       We have been extensively using the CVP XML API feature for backend intergration,  and we have this third party service interface, which requires something similar to XML API,  but the DTD is different.  hence I tried to use an Action element java class and utilise the java.net package classes,  The thirdparty interface takes an XML string as a input and the
response is also an XML data,  and the idea is to parse this XML data
in the CVP and play the data to the caller.

            String postString = "inputs=" + cvpCall.buildClaimLockInputs();
           
            URL url = new URL(cvpCall.getURL());   
           
            HttpURLConnection connection = (HttpURLConnection)url.openConnection();
           
            System.out.println("The absolute URL is " + cvpCall.getURL()+ "?" + postString);
            connection.setRequestMethod("POST");
            connection.setDoOutput(true);
            connection.setDoInput(true);
            connection.setUseCaches(false);
            connection.setAllowUserInteraction(false);
            //connection.setFollowRedirects(false);
           
            connection.connect();
           

            OutputStream os = connection.getOutputStream();
           
            DataOutputStream dos = new DataOutputStream(os);
           
            dos.writeBytes(postString);
           
            dos.close();
 
 
      I tested the above code in a standalone java class connecting to the third party URL and able to get the response,  and able to print it by,
 
            InputStream ipStream = connection.getInputStream();
           
            InputStreamReader ipsRead = new InputStreamReader(ipStream);
           
            BufferedReader buffRead = new BufferedReader(ipsRead);
           
            while(buffRead.read() != -1)
            {
                System.out.println(buffRead.readLine() + "\n");
            }
 
     But if I make the above class as part of an Action Element class,   I don't see any error in the Call Activity log NOR the Error log shows anything,  but the third party service has NOT received the request and NO response as well.
 
     Does CVP prevents any custom HTTP request within the application,   any workaround for this.
 
     A quick response would be greatly appreciated,
 
regards,
AV

Subject: RE: Action element class invoking a HTTP request
Replied by: Ranjana Narayan on 20-07-2009 09:35:01 AM
Hi,

You should be able make Http requests from an Actionelement of a CVP application.

Have you checked the Global logs? Any kind of errors should either be logged in the application or the global error logs.
Try inserting some logging statements within the code snippets to trace where execution fails.

Hope this helps,
Ranjana.

Subject: RE: Action element class invoking a HTTP request
Replied by: Juned Ahsan on 22-07-2009 12:26:41 PM
Hey,
 
VXML server does not block any HTTP request but yes sometimes it is  hard to track the error when there is no error information in Activity or Error Log. Have you tried checking in CVP server log and also your web server logs. Sometimes we get to see the error information in the CVP server log or the web server log. I suspect in your case that you should get your error/exception info in your web server log.
 
Regards,
 Juned

Subject: RE: Action element class invoking a HTTP request
Replied by: NEW USER on 06-08-2009 03:20:12 PM
 Thanks Ranjana & Juned,   its working now.   Its the classpath issue,  as my connection class has a long package name and the java/application/classes path didn't have the reqd. path.
 
thanks again,
AV
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Quick Links