" /> access URL from GVP application - Genesys CTI User Forum

Author Topic: access URL from GVP application  (Read 3157 times)

Offline dnib

  • Jr. Member
  • **
  • Posts: 57
  • Karma: 0
access URL from GVP application
« on: October 09, 2012, 10:55:18 AM »
Advertisement
Hello!

I am trying to access and URL (with returns a XML) from a GVP application. I have a jsp that can connect to the URL from my server, but when I insert the code into a CODE Block in GVP Studio i get "url cannot be resolved".

Do you have any idea what can be the problem here? 

Here is my code from CODE BLOCK:

[i]<%@ page language="java" import="org.w3c.dom.*,javax.xml.parsers.DocumentBuilder,javax.xml.parsers.DocumentBuilderFactory,java.net.*,java.io.*" pageEncoding="ISO-8859-1"%>
<%!
     
                  public void processBegin(PageContext localPageContext){

}

                  public void processAnywhere(PageContext localPageContext){
     
String xml="";
String id ="http://www.yahoo.com";

try {
URL url = new URL(id);
    url.openConnection();
}
catch (MalformedURLException e) {   
System.out.println(e.getMessage());
BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));             
String InputLine = null ;
while ((InputLine = in.readLine()) != null) {
xml  += InputLine;
              }
in.close();
}
setPageItem (localPageContext, "vXML",xml);
                 
}
//Can be used for writing the custom code that needs to get
//executed after the vxml page ends.can be used for doing cleanup
//Use "addStuff" variable for generating custom VXML code.

                  public void processEnd(PageContext localPageContext){
     
                  }
                %>[/i]

Offline Fra

  • Hero Member
  • *****
  • Posts: 856
  • Karma: -3
Re: access URL from GVP application
« Reply #1 on: October 09, 2012, 12:17:43 PM »
networks 101 + google: how http addresses are resolved.

Good luck

Fra

Offline dnib

  • Jr. Member
  • **
  • Posts: 57
  • Karma: 0
Re: access URL from GVP application
« Reply #2 on: October 11, 2012, 08:42:35 AM »
Hi,

Maybe I am missing something. Because the link can be accessed from the same server using a jsp file containing the same code as the GVP studio application.

Maybe when Studio compiles the code it alters something... so i don't think is caused by the url not being resolved.


PS: in both attempts the same Apache server is being used.