cancel
Showing results for 
Search instead for 
Did you mean: 

SUP 2.1.2: Can't register Android Device to SUP through a Relay Server

Former Member
0 Kudos

Greetings.

We can't register an android device vs SUP through the relay

server.

However, if we register the device directly vs SUP, then we

can synchronize data through the relay server (setting up

the SynchronizationProfile accordingly).

The relay server is up and working, and so is the RSOE.

We register a new connection @ SUP control center, setting

up the relay server ip, port and farm. Then, we start the

application with the ConnectionProperties the way we think

it's meant to:

...

ConnectionProperties props = app.getConnectionProperties();

props.setServerName("relay server ip");

props.setPortNumber("relay server http port");

props.setFarmId("farm id");

props.setNetworkProtocol("http");

props.setUrlSuffix("/ias_relay_server/client/rs_client.dll/"farm

id");

....

MyAppDB.registerApplication() --> throws a Exception.

This is the log:

...

Starting URL Template discovery

Testing Relay Server URL Template: /tm/?cid=%cid%

Testing Relay Server URL Template:

/cli/iarelayserver/%cid/tm

Testing Relay Server URL Template:

/ias_relay_server/client/rs_client.dll/%cid%/tm

...

Did NOT find good Relay Server URL Template

-


Exception: "Could not connect to server. Verify Relay Server

URL Template"

Is it possible to register the device through the relay

server? Or is it just meant to be used for the data

(synchronization) channel?

If so, what are we missing?

Thanks.

Edited by: p4inkiller on Mar 7, 2012 1:28 PM

Accepted Solutions (1)

Accepted Solutions (1)

rohith_deraje
Advisor
Advisor
0 Kudos

Hi,

You can try by commenting below line in your code. I am not expert on the relay server. But we successfully connect our SUP2.1.2-ODP Android apps thorugh relay server using only host, port and farm id.

//props.setUrlSuffix("/ias_relay_server/client/rs_client.dll/"farmid");

Regards

Rohith

Former Member
0 Kudos

Thanks Rohith for your answer. Unfortunately, it's not working.

I've been struggling with this for a couple of weeks now and I'm stuck here.

Could you show me some code in order to check if I'm doing it right? (I mean the registration part).

Edited by: p4inkiller on Mar 7, 2012 5:17 PM

rohith_deraje
Advisor
Advisor
0 Kudos

Hi,

Its little different in SUP-ODP. Below is the code snippet for registration.

try {

/* STEP1:Initialize the App */

LiteUserManager.initInstance(getApplicationContext(), "FirstAPP");

/* STEP2:Provide SUP connection Settings and Register the User */

LiteUserManager usrMngr = LiteUserManager.getInstance();

// usrMngr.setConnectionProfile(Relay_Server_Host, Port, FormID/companyID);

if (!usrMngr.isRegistered()) {

usrMngr.setConnectionProfile("relayserver.sybase.com", 80, "Company1");

// usrMngr.registerUser(userName, actCode);

usrMngr.registerUser("APPUSER", "123");

}

} catch (MessagingClientExceptione) {

e.printStackTrace();

}

Also the relay server configuration step we follow is as below.

Step1---->Adding relay server details.

Select the first parent node in the left pane of SCC. Ex: Localhost@Localhost(Running).

Click on u201CRelay Serveru201D Tab.

Enter Relay server Host. Ex: 10.77.188.99 OR relayserver.sybase.com(if you are using

Sybase Hosted relay server.

Enter HTTP port. Ex: 80

Enter HTTPS port Ex: 443

Click Next and Enter the FarmID.

Choose Type as Messaging.

Enter Description and click u201C+u201D to add the farm to the table.

Select the above added Farm from Table.

Enter the Server NodeID and Token and click on u201C+u201D to add.

*In case of Sybase hosted relay server, Token is automatically generated when you create a new Farm.

Step2--->Creating outbound enabler

Expand the node u201CServeru201D on the left side pane.

Select u201CServer Configurationu201D.

Click on the u201COutbound Enableru201D Tab.

Click o u201CNewu201D to add a new configuration.

In the wizard, choose Farm Type as u201CMessagingu201D. Choose the relay server host, port ,Farm and Node ID configured above. Save the changes.

Select the outbound enabler and u201CStartu201D.

The u201CStatusu201D should turn to Running.

Regards

Rohith

Former Member
0 Kudos

Thanks again Rohith.

We have only defined one RSOE (Replication based).

Do we need to define another, Messaging based, RSOE in order to get the device to register with SUP through the relay server?

-


By the way, may I share this I've just found:

So, with our setup this is the connection flow:

Android device --> (http 3009) Relay Server --> (tcp? 2480 RSOE) SUP

Everytime I try to register the Android device, these two lines appear in RSOE log:

I. 2012-03-07 17:49:06. <Backend-0000> Reusing sidx=5 for ridx=0

E. 2012-03-07 17:49:06. <Backend-0000> DoneSend: interrupted send operation on socket=0090d330

And these two lines appear in SUP server log:

2012-03-07 17:49:06.475 ERROR Mobilink Thread-202 [com.sybase.ml.sup.Logger] [-10117] Flow error: Unknown transfer codification: 'chunked'.

2012-03-07 17:49:03.755 ERROR Mobilink Thread-202 [com.sybase.ml.sup.Logger] [-10117] Flow error: Unknown transfer codification: 'chunked'.

Do you know the cause? Thanks.

Edited by: p4inkiller on Mar 7, 2012 6:30 PM

rohith_deraje
Advisor
Advisor
0 Kudos

Hi,

Sorry, I have no idea on the error.

Hope information available at below link would be helpful to you. http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc01092.0212/doc/html/koh12...

Regards

Rohith

Former Member
0 Kudos

Thanks Rohith for your support.

Finnally managed to make it work.

Just in case someone is interested:

It takes two farms (one for Replication (port 2480) and another one for Messaging (port 5001)).

Then, you set up two RSOE processes (one for each farm). We're using the same Relay Server port for both farms.

The Messaging farm is used for registering the Android device, and the Replication farm is used for synchronizing data.

Former Member
0 Kudos

Hello,

Thank you for the update! Can you please share your connection code in android and the settings in the application connection template of your Application in the SCC (Connection and Custom Settings)?

Did you make any other configurations?

thanks

Stefan

rakshit_doshi
Active Contributor
0 Kudos

Hi Pablo,

How did you make it work..Is the user getting authenticated  by connecting through the relayserver??

Can you kindly share the code for reference

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi there,

I tried all ways written in this post but still i am getting same error with some extra exceptions.

Here i my code;

ConnectionProperties connProps = app.getConnectionProperties();

connProps.setServerName("192.168.1.69");// Relay server IP

connProps.setPortNumber(80);//Relay server Port no

connProps.setFarmId("xyz.SUPFarmRBS");//Relay server farm id

connProps.setNetworkProtocol("http");?// protocol

connProps.setUrlSuffix("/ias_relay_server/client/rs_client.dll/xyz.SUPFarmRBS");

LoginCredentials loginCredentials = new LoginCredentials(USERNAME, PASSWORD);

connProps.setLoginCredentials(loginCredentials);

// connProps.setServerName(HOST);

// connProps.setPortNumber(PORT);

if (app.getRegistrationStatus() != RegistrationStatus.REGISTERED)

{

app.registerApplication(TIMEOUT);// this is the line where exception got generated

}

else

{

app.startConnection(TIMEOUT);

}

if (!SUP101DB.isSynchronized("default"))

{

SUP101DB.disableChangeLog();

SUP101DB.synchronize(); // Initial Synchronize

SynchronizationGroup sg = SUP101DB.getSynchronizationGroup("default");

sg.setEnableSIS(true);

sg.save();

SUP101DB.synchronize();

}

SUP101DB.enableChangeLog();

}

catch (Exception e)

{

e.printStackTrace();

}

finally

{

initializationDone = true;

}

I am getting few exceptions;

1. 03-10 15:09:52.002: W/System.err(773): com.sybase.mobile.ApplicationRuntimeException: Error: 558 Message: 'Could not connect to server. Verify Relay Server URL Template'

2.03-10 15:10:27.273: W/dalvikvm(773): Exception Ljava/lang/UnsatisfiedLinkError; thrown during Lcom/ianywhere/ultralitejni12/implementation/JniDbMgr;.<clinit>

3.03-10 15:10:56.902: E/AndroidRuntime(773): Caused by: java.lang.UnsatisfiedLinkError: Library ultralitej12 not found

4.03-10 15:10:56.902: E/AndroidRuntime(773): java.lang.ExceptionInInitializerError

If any one has done it before request you to share the code which is working.