Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Question about Afaria Java Client API

2 posts in General Last posting was on 2008-06-23 16:33:41.0Z
Xiong HE Posted on 2008-06-20 06:33:49.0Z
From: "Xiong HE" <xionghe@sybase.com>
Newsgroups: ianywhere.public.afaria.general
Subject: Question about Afaria Java Client API
Lines: 4
MIME-Version: 1.0
Content-Type: text/plain; format=flowed; charset="gb2312"; reply-type=original
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
Importance: Normal
X-Newsreader: Microsoft Windows Live Mail 12.0.1606
X-MimeOLE: Produced By Microsoft MimeOLE V12.0.1606
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <485b4f4d$1@forums-1-dub>
Date: 19 Jun 2008 23:33:49 -0700
X-Trace: forums-1-dub 1213943629 10.22.241.152 (19 Jun 2008 23:33:49 -0700)
X-Original-Trace: 19 Jun 2008 23:33:49 -0700, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.afaria.general:40
Article PK: 141

In Java Client API,

The API: connect(String ipAddress, int channelID)

What's the meaning of channelID, where can I get it?


for (int i=0; i<65536; ++i)
{
ret = theclient.connect

("afaria", "*****", "hostname", 3007,
"BJEASPE2901\\demo_unc_sess_mgr", i);
System.out.println("i: " + i + ", ret: " + ret);
if (ret == 0)
{
break;
}
}

In my code, I tried the ID in a loop, the connection always failed.


Thanks in advance.


--

Regards,
Xiong HE


Christopher Heeter Posted on 2008-06-23 16:33:41.0Z
Reply-To: "Christopher Heeter" <SybaseiAnywhere@Live.com>
From: "Christopher Heeter" <SybaseiAnywhere@Live.com>
Newsgroups: ianywhere.public.afaria.general
References: <485b4f4d$1@forums-1-dub>
Subject: Re: Question about Afaria Java Client API
Lines: 408
Organization: Sybase iAnywhere
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <485fd065$1@forums-1-dub>
Date: 23 Jun 2008 09:33:41 -0700
X-Trace: forums-1-dub 1214238821 10.22.241.152 (23 Jun 2008 09:33:41 -0700)
X-Original-Trace: 23 Jun 2008 09:33:41 -0700, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.afaria.general:45
Article PK: 172

Xiong,

If you need to use the other version(s) for the Connect method,
you can probably obtain the internal Channel ID by performing the following:



Make the Session Channel viewable to a Windows Client (Client
Type). Have the Windows Client connect to the Á¡publishedÁ± Channel at
least once. Then Á¡unPublishÁ± the Channel. Have the Windows Client attempt
to connect again. Look in the Messages log for your Server. You should
receive an error that the request Channel was unpublished. I believe that
message string will provide you the internal Channel ID. If that is not the
correct internal ID for the Channel add or subtract a value of 1 and try
again.





When requesting a channel by name, you must ensure the channelName parameter
contains the full path to the channel in one of the following ways:



? A - <ServerName>\[<FolderName>]\<ChannelName>

where the Server name is case-sensitive and [ ] indicates optional



? B - $root$\[<FolderName>]\<ChannelName>

where [ ] indicates optional



If it still will not work, I recommend opening a case with Technical
Support, as it may be an issue for Java on Windows. The Java Client and
Java API originally where designed for Linux, so there may be an unknown
issue for Java on WindowsÁ?



Thanks,
Christopher J. Heeter

Online Support

Sybase iAnywhere

(678) 585-7135

http://frontline.sybase.com/support



http://www.sybase.com/ianywhere



_____________________________________________
From: Xiong He [mailto:Xiong.He@sybase.com]
Sent: Monday, June 23, 2008 9:47 AM
To: Chris Heeter
Subject: RE: Help about Afaria java client api calls



Hi Chris,



If I use the API public final int connect( String xecFile ), no issues.

But I have to use the following API.



/**

* Connect to a transmitter and execute the specified channel.

* <p>

*

* @param username The username of the connecting user (can be null).

* @param password The password for the user connecting (can be null).

* @param ipAddress The IP address or registered

* domain name of the Transmitter/Server.

* @param ipPort If IP port of the server

* @param channelName The name of the channel to

* execute (can be null. ignored if channelID is non-zero).

* @param channelID The channel unique identifier to be executed.

*

*/

public final int connect( String username, String password, String
ipAddress, int

ipPort, String channelName, int channelID )



So, there is a call like :

ret = theclient.connect("", "", "bjeaspe2901", 3007, "demo_unc_sess_mgr",
0);

"demo_unc_sess_mgr" is just the channelName.



I just wonder why this way didn't work.

My Env is:

Afaria server: win2003

Afaria client: winxp













Regards,

Xiong HE









Chris Heeter 06/23/2008 09:10 PM
To
Xiong He/SYBASE

cc


Subject
RE: Help about Afaria java client api calls














Xiong He,

I believe you are trying to mix different versions for the connect
method. If you want to specify an XEC file (HTML Parameter File) you only
need to specify the full path the file name. Also, what OS are your
runnings Java on? Is it Linux or Windows? I was just curious.

/**

* Connect to a transmitter and execute the session information contained in

* the XEC file passed.

* <p>

*

* @param xecFile The name of the XEC file to process.

*/

public final int connect( String xecFile )

{

}

Thanks,

Christopher J. Heeter

Online Support

Sybase iAnywhere

(678) 585-7135

http://frontline.sybase.com/support

http://www.sybase.com/ianywhere

_____________________________________________

From: Xiong He

Sent: Sunday, June 22, 2008 10:36 AM

To: Chris Heeter

Subject: RE: Help about Afaria java client api calls

Hi Chris,

Thanks again.

I did not use authentication for the session channel.

So I used :

ret = theclient.connect("", "", "bjeaspe2901", 3007, "demo_unc_sess_mgr",
0);

No username, no password. But the connect failed too. The ret code is still
100.

I'm somewhat confused now.



Regards,

Xiong HE

Chris Heeter 06/20/2008 08:08 PM To

Xiong He/SYBASE

cc

Subject

RE: Help about Afaria java client api calls



Xiong He,

I believe you mixing the two different connect methods. If you
specify an XEC file (HTML Parameter File) you only need the name of the file
(full path included). The ChannelID is an internal number assigned to a
Channel at the Server. It is not exposed in the Afaria Administrator and
therefore not easy to find anywhere.

Using an XEC file is the Á¡easiestÁ± method for connect since it will
contain all the parameters (which includes the internal ChannelID) except
the credentials passed for Afaria Authentication.

In regards to the usage of the user name and password, I believe you
are mixing up Afaria Authentication for the Session and Access Policy for
the Afaria Administrator. What role a user is assigned to in the Afaria
Administrator Access Polices (Help Desk you mentioned) has nothing to do
with credentials that are passed during a Session. For Afaria
Authentication you must setup the following on your server:

1. Authentication must be enabled.

2. When you installed Afaria you pointed to a traditional Domain or to
an LDAP provider (Active Directory, Novell NDS, or Netscape Directory
Services). You must valid user name and password that exists in the domain
or directory service back-end.

3. You must format the credential properly ¬C i.e. if you sing domain
you may have to specify SYBASE\Cheeter, is using MS Active Directory
(depending on options you chose during installation of Afaria Server), you
may have to specify Cheeter@Sybase.com (mailto:Cheeter@Sybase.com)

Thanks,

Christopher J. Heeter

Online Support

Sybase iAnywhere

(678) 585-7135

http://frontline.sybase.com/support

http://www.sybase.com/ianywhere

_____________________________________________

From: Xiong He

Sent: Friday, June 20, 2008 12:32 AM

To: Chris Heeter

Subject: Help about Afaria java client api calls

Hi Chris,

First, thanks for your kindly help in the newsgroup.

Now, I have another question about the java client API call of Afaria.

I modified the sample program in the API reference manual of Afaria.

In the main class AfariaClientTest,

I used:

ClientApiImpl theclient = new ClientApiImpl();

int ret = theclient.connect("afaria", "sybase_1",
"bjeaspe2901", 3007,

//"demo_unc_sess_mgr",

"e:\\xionghe\\Afaria\\Data\\Channel\\HTML\\demo_unc_sess_mgr.xec",

0);

The session name
"e:\\xionghe\\Afaria\\Data\\Channel\\HTML\\demo_unc_sess_mgr.xec" is in the
afaria server: bjeaspe2901.

3007 is the default port.

username "afaria" and password "sybase_1" is a local user in the machine
bjeaspe2901. (bjeaspe2901\afaria)

And I have add the user to the "Help Desk" role for the server bjeaspe2901.

I don't know what's the meaning of the channel ID.

I test the program in my local machine.

But it always failed with:

Debug Msg: null

ret code = 100

Could you help?

Regards,

Xiong HE

"Xiong HE" <xionghe@sybase.com> wrote in message
news:485b4f4d$1@forums-1-dub...
> In Java Client API,
>
> The API: connect(String ipAddress, int channelID)
>
> What's the meaning of channelID, where can I get it?
>
>
> for (int i=0; i<65536; ++i)
> {
> ret = theclient.connect
> ("afaria", "*****", "hostname", 3007,
> "BJEASPE2901\\demo_unc_sess_mgr", i);
> System.out.println("i: " + i + ", ret: " + ret);
> if (ret == 0)
> {
> break;
> }
> }
>
> In my code, I tried the ID in a loop, the connection always failed.
>
>
> Thanks in advance.
>
>
> --
>
> Regards,
> Xiong HE