cancel
Showing results for 
Search instead for 
Did you mean: 

starting channel through

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi ramesh

The url works fine when i run url in browser. it starts and stops channel accordingly.

I need help on UDF

Regards

Sandeep