cancel
Showing results for 
Search instead for 
Did you mean: 

Javs Connection in UDF

Former Member
0 Kudos

Hi all,

I am trying to read a webpage in UDF using the below code. But i get the connection time out. Can any body please suggest the possible reason?

try {

URL google = new URL("http//www.google.com");

result.addValue(""+google);

URLConnection yc = google.openConnection();

BufferedReader in = new BufferedReader(new InputStreamReader(yc

.getInputStream()));

while ((inputLine = in.readLine()) != null) {

result.addValue(inputLine);

break;

}

in.close();

} catch (Exception e) {

result.addValue(""+e);

}

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

URL google = new URL("http//www.google.com");
change
URL google = new URL("http://www.google.com");

you are missing : in between http://

Former Member
0 Kudos

Hello Anand,

Thanks for the information. That was just a typing error. Actaul problem still remains the same. Can you suggest

Thanks,

-Kulwant

Former Member
0 Kudos

i ran the same code and it worked for me. check the firewall settings if u have.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi

Internet access should be there on XI server to execute your mapping. If it is under firewall just check with that to solve this.

UDF looks ok

Thanks

Gaurav