I can invoke the worklight adaptor procedure in my machine by using the below URL.
Now, i want to invoke this from a java program.
Code goes like this,
try {
URL myURL = new URL("http://192.168.1.101:10080/AdaptorUI /dev/invoke?adapter=MySQLAdaptor&procedure=procedure1¶meters=[]");
URLConnection myURLConnection = myURL.openConnection();
myURLConnection.connect();
}
catch (MalformedURLException e) {
// new URL() failed
// ...
System.out.println("Inside the MalformedURLException");
}
catch (IOException e) {
// openConnection() failed
// ...
System.out.println("IOException");
}
Somehow the above program is not working. Can you pls help ?
First, you should probably remove the /dev from the URL; /dev should be used only in a development environment.
Second, I suggest looking at the solution provided to this question: Java URL doesn't seem to connect, but no exception thrown
From the comments: Missing line of code: