Skip to Content
0
Former Member
Dec 08, 2011 at 10:35 AM

starting channel through

35 Views

Hi All

I tried starting channel through UDF i had all the authorizations .but getting 401 response code

URL server = new URL("http://host:port/AdapterFramework/ChannelAdminServlet?party=&service=""&channel=""r&action=start");

//Hard code User Name & Password

String userPassword = "username" + ":" + "password";

URLConnection uc=server.openConnection();

uc.setRequestProperty ("Authorization", userPassword);

uc.connect();

BufferedReader br = new BufferedReader(new InputStreamReader(uc.getInputStream()));

String inputLine = "";

String output = "";

while (( inputLine = br.readLine()) != null)

output+=inputLine;

System.out.print(output);

br.close();

please let me know if this is wrong..please help me to achieve it

Regards

Sandeep