on 12-08-2011 10:35 AM
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
Hi Sandeep,
I am not sure about the code, but can you try?
Since it is URL you need to POST it right?
Add these lines instead of
HttpURLConnection uc =(HttpURLConnection) new
URL(server).openConnection();
uc.setDoOutput(true);
uc.setRequestMethod("POST");
URLConnection uc=server.openConnection();
uc.setRequestProperty ("Authorization", userPassword);
uc.connect();
Regards
Ramesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Try with this URL
http(s)://host:port/AdapterFramework/ChannelAdminServlet?party=party&service=service&channel=channel&action=start
URL server = new URL("http://host:port/AdapterFramework/ChannelAdminServlet?
party=&service=""&channel=""*r*&action=start");
is it required here or is it a typo error?
regards
Ramesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
From help link
To control communication channels externally,
you use an HTTP GET or POST request to the following URL:
http(s)://host:port/AdapterFramework/ChannelAdminServlet?
party=party&service=service&channel=channel&action=action
The parameters in italics are described in the following table:
party
Identifies the party of the channel to be administered. You can use an
asterisk (*) as a placeholder to administer several channels simultaneously.
service
Identifies the communication component of the channel to be administered. You can
use an asterisk (*) as a placeholder to administer several channels simultaneously.
channel
Identifies the name of the channel to be administered. You can use
an asterisk (*) as a placeholder to administer several channels simultaneously.
action
Identifies the action to be executed (start, stop, or status).
You use the start and stop actions to start and stop the channels.
You can use the status action to query the status of one or more channels
Edited by: Ramesh P on Dec 8, 2011 4:34 PM
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.