cancel
Showing results for 
Search instead for 
Did you mean: 

Device Registration through Relay Server Android SUP 2.1.2

rakshit_doshi
Active Contributor
0 Kudos

Hi,

Can anyone help out with the steps for registering the user through a relay server. Please help along with the code snippet.

Accepted Solutions (1)

Accepted Solutions (1)

rohith_deraje
Advisor
Advisor
0 Kudos
Hi Rakshit,
You do not need any additional coding to pass through relay server.
With relay server, the setup would be like "SUP<-->Relay<---> Client/Device". Here relay just acts like a reverse proxy.You just need to pass relay server host, port and farm ID to the registration API.
The detailed step by step procedure to create farm and outbound enabler is mention in doc http://scn.sap.com/docs/DOC-23532. Section "Creating relay server configuration in SCC". This doc also has the SUP-ODP registraion code snippet for android.
Once outbound enabler is created i SCC,Select the outbound enabler and "Start". The "Status" should turn to Running.
Also if you are trying to register from device, please check if you are able to reach relay server through browser.
Thanks and Regards
Rohith
rakshit_doshi
Active Contributor
0 Kudos

Hi Rohith,

I tried following the steps and referring to the document i did complete all the steps required to configure the relay server was still not able to connect..And in the sample project you used something of LiteManager class but what i used is importing libraries from the folder  UnwiredPlatform\MobileSDK\ObjectAPI\Android (3 jar files) and i was using the ConnectionProperties for connecting through the relay server..

Have you ever used that thing and tried to connect.

Secondly when i tried to connecting through direct IP and 5001 port i was able to register but not able to Synchronize.

It showed this error. Can you please help me out.

05-02 13:00:31.112: E/AndroidRuntime(529): FATAL EXCEPTION: main

05-02 13:00:31.112: E/AndroidRuntime(529): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.prism.vista/com.prism.vista.MainActivity}: com.sybase.persistence.SynchronizeException: com.ianywhere.ultralitejni12.implementation.JniException: UltraLiteJ Error[-857]: Synchronization failed due to an error on the server: [-10244] The MobiLink server has encountered an error and the synchro

05-02 13:00:31.112: E/AndroidRuntime(529):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956)

05-02 13:00:31.112: E/AndroidRuntime(529):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)

05-02 13:00:31.112: E/AndroidRuntime(529):     at android.app.ActivityThread.access$600(ActivityThread.java:123)

05-02 13:00:31.112: E/AndroidRuntime(529):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)

05-02 13:00:31.112: E/AndroidRuntime(529):     at android.os.Handler.dispatchMessage(Handler.java:99)

05-02 13:00:31.112: E/AndroidRuntime(529):     at android.os.Looper.loop(Looper.java:137)

05-02 13:00:31.112: E/AndroidRuntime(529):     at android.app.ActivityThread.main(ActivityThread.java:4424)

05-02 13:00:31.112: E/AndroidRuntime(529):     at java.lang.reflect.Method.invokeNative(Native Method)

05-02 13:00:31.112: E/AndroidRuntime(529):     at java.lang.reflect.Method.invoke(Method.java:511)

05-02 13:00:31.112: E/AndroidRuntime(529):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)

05-02 13:00:31.112: E/AndroidRuntime(529):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)

05-02 13:00:31.112: E/AndroidRuntime(529):     at dalvik.system.NativeStart.main(Native Method)

05-02 13:00:31.112: E/AndroidRuntime(529): Caused by: com.sybase.persistence.SynchronizeException: com.ianywhere.ultralitejni12.implementation.JniException: UltraLiteJ Error[-857]: Synchronization failed due to an error on the server: [-10244] The MobiLink server has encountered an error and the synchro

05-02 13:00:31.112: E/AndroidRuntime(529):     at com.sybase.sup.client.persistence.RbsDatabaseDelegate.internalSynchronize(RbsDatabaseDelegate.java:689)

05-02 13:00:31.112: E/AndroidRuntime(529):     at com.sybase.sup.client.persistence.RbsDatabaseDelegate.synchronize(RbsDatabaseDelegate.java:1050)

05-02 13:00:31.112: E/AndroidRuntime(529):     at com.sybase.sup.client.persistence.RbsDatabaseDelegate.synchronize(RbsDatabaseDelegate.java:1041)

05-02 13:00:31.112: E/AndroidRuntime(529):     at Vistaland.VistalandDB.synchronize(VistalandDB.java:197)

05-02 13:00:31.112: E/AndroidRuntime(529):     at com.prism.vista.MainActivity.initializeApplication(MainActivity.java:90)

05-02 13:00:31.112: E/AndroidRuntime(529):     at com.prism.vista.MainActivity.onCreate(MainActivity.java:46)

05-02 13:00:31.112: E/AndroidRuntime(529):     at android.app.Activity.performCreate(Activity.java:4465)

05-02 13:00:31.112: E/AndroidRuntime(529):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)

05-02 13:00:31.112: E/AndroidRuntime(529):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)

05-02 13:00:31.112: E/AndroidRuntime(529):     ... 11 more

05-02 13:00:31.112: E/AndroidRuntime(529): Caused by: com.ianywhere.ultralitejni12.implementation.JniException: UltraLiteJ Error[-857]: Synchronization failed due to an error on the server: [-10244] The MobiLink server has encountered an error and the synchro

05-02 13:00:31.112: E/AndroidRuntime(529):     at com.ianywhere.ultralitejni12.implementation.JniConnection.ulcSynchronize(Native Method)

05-02 13:00:31.112: E/AndroidRuntime(529):     at com.ianywhere.ultralitejni12.implementation.JniConnection.synchronize(Unknown Source)

05-02 13:00:31.112: E/AndroidRuntime(529):     at com.sybase.sup.client.persistence.RbsDatabaseDelegate.internalSynchronize(RbsDatabaseDelegate.java:616)

05-02 13:00:31.112: E/AndroidRuntime(529):     ... 19 more

Former Member
0 Kudos

Hi Rakshit,

I have managed to get this out recently you could refer the post written by me

http://scn.sap.com/community/mobile/blog/2012/05/02/sup-212-native-android-mbo-non-doe-based-approac...

Srinivas Divakarla

rakshit_doshi
Active Contributor
0 Kudos

Hi Srinivas,

This is it...Thanks a ton for all your hard work.. 

Former Member
0 Kudos

Hi Rakhsit,

probably you can also rate the content/like the content/and comment the content, apart from that you add your valuable suggestion also to server the good content

Thank you so much

Happy to help though..

Thank you very much

Cheers,

Srinivas Divakarla

rakshit_doshi
Active Contributor
0 Kudos

Hi Srinivas,

I got this ultraliteJ error while i tried to synchronize. Do you have any idea how to resolve this?

05-03 09:10:36.583: E/AndroidRuntime(538): FATAL EXCEPTION: main

05-03 09:10:36.583: E/AndroidRuntime(538): com.sybase.persistence.SynchronizeException: com.ianywhere.ultralitejni12.implementation.JniException: UltraLiteJ Error[-857]: Synchronization failed due to an error on the server: [-10244] The MobiLink server has encountered an error and the synchro

05-03 09:10:36.583: E/AndroidRuntime(538):     at com.sybase.sup.client.persistence.RbsDatabaseDelegate.internalSynchronize(RbsDatabaseDelegate.java:689)

05-03 09:10:36.583: E/AndroidRuntime(538):     at com.sybase.sup.client.persistence.RbsDatabaseDelegate.synchronize(RbsDatabaseDelegate.java:1050)

05-03 09:10:36.583: E/AndroidRuntime(538):     at com.sybase.sup.client.persistence.RbsDatabaseDelegate.synchronize(RbsDatabaseDelegate.java:1041)

05-03 09:10:36.583: E/AndroidRuntime(538):     at Vista.VistaDB.synchronize(VistaDB.java:197)

05-03 09:10:36.583: E/AndroidRuntime(538):     at com.prism.vista.MainActivity.initializeApplication(MainActivity.java:104)

05-03 09:10:36.583: E/AndroidRuntime(538):     at com.prism.vista.MainActivity.access$5(MainActivity.java:77)

05-03 09:10:36.583: E/AndroidRuntime(538):     at com.prism.vista.MainActivity$1.onClick(MainActivity.java:64)

05-03 09:10:36.583: E/AndroidRuntime(538):     at android.view.View.performClick(View.java:3511)

05-03 09:10:36.583: E/AndroidRuntime(538):     at android.view.View$PerformClick.run(View.java:14105)

05-03 09:10:36.583: E/AndroidRuntime(538):     at android.os.Handler.handleCallback(Handler.java:605)

05-03 09:10:36.583: E/AndroidRuntime(538):     at android.os.Handler.dispatchMessage(Handler.java:92)

05-03 09:10:36.583: E/AndroidRuntime(538):     at android.os.Looper.loop(Looper.java:137)

05-03 09:10:36.583: E/AndroidRuntime(538):     at android.app.ActivityThread.main(ActivityThread.java:4424)

05-03 09:10:36.583: E/AndroidRuntime(538):     at java.lang.reflect.Method.invokeNative(Native Method)

05-03 09:10:36.583: E/AndroidRuntime(538):     at java.lang.reflect.Method.invoke(Method.java:511)

05-03 09:10:36.583: E/AndroidRuntime(538):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)

05-03 09:10:36.583: E/AndroidRuntime(538):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)

05-03 09:10:36.583: E/AndroidRuntime(538):     at dalvik.system.NativeStart.main(Native Method)

05-03 09:10:36.583: E/AndroidRuntime(538): Caused by: com.ianywhere.ultralitejni12.implementation.JniException: UltraLiteJ Error[-857]: Synchronization failed due to an error on the server: [-10244] The MobiLink server has encountered an error and the synchro

05-03 09:10:36.583: E/AndroidRuntime(538):     at com.ianywhere.ultralitejni12.implementation.JniConnection.ulcSynchronize(Native Method)

05-03 09:10:36.583: E/AndroidRuntime(538):     at com.ianywhere.ultralitejni12.implementation.JniConnection.synchronize(Unknown Source)

05-03 09:10:36.583: E/AndroidRuntime(538):     at com.sybase.sup.client.persistence.RbsDatabaseDelegate.internalSynchronize(RbsDatabaseDelegate.java:616)

05-03 09:10:36.583: E/AndroidRuntime(538):     ... 17 more

Former Member
0 Kudos

Hi Rakhsit,

Are you able to subscribe & synchronize by directly connecting to SUP?

Regards,

Srinivas Divakarla

rakshit_doshi
Active Contributor
0 Kudos

Till yesterday this code was working perfectly fine.. Dont know what went wrong all of a sudden

Former Member
0 Kudos

Hi Rakhsit,

also ensure that,

For linux Relay Server it has to be:

streamParams.setUrl_Suffix("/cli/iarelayserver/developmentRBS");

For Windows Relay Server it has to be:

streamParams.setUrl_Suffix(""/ias_relay_server/client/rs_client.dll/developmentRBS");

Regards,

Srinivas Divakarla

Answers (2)

Answers (2)

rakshit_doshi
Active Contributor
0 Kudos

Yes i am able to connect to the SUP widout relay server..But i am unable to with the relay server..Kindly Suggest

Ian_Thain
Developer Advocate
Developer Advocate
0 Kudos

Apologies if you have tried this but...

I would look at the Outbound Enabler Configuration file you created in on the SUP server, called <supservername>.config and check  the setting you made suggested from the hosted RS.

Then start the RSOE using the command rsoe  @<supservername>.config

You shouldn't need to change your app code, just the connection setting for the RS

Ian

rakshit_doshi
Active Contributor
0 Kudos

Hi Ian,

Can you elaborate a more on the above answer?

Ian_Thain
Developer Advocate
Developer Advocate
0 Kudos

Rakshit

When you registered for the Hosted Relay Server you would have been supplied with the configuration Instructions for creating an Outbound Enabler Configuration file that resides on your SUP server and that should be started on the server.

Firstly, I would suggest you log back in to the Hosted Relay Server Service (that you registered on)  and check the left hand menu for a section called Configuration Instructions

Ian

Ian_Thain
Developer Advocate
Developer Advocate
0 Kudos

I hope this helps

Ian

rakshit_doshi
Active Contributor
0 Kudos

Hi Ian,

I did all the configuration as mentioned in the configuration page..Still not able to..:(

Ian_Thain
Developer Advocate
Developer Advocate
0 Kudos

Rakshit

Are you able to get any debug information from your app?

Ian

Ian_Thain
Developer Advocate
Developer Advocate
0 Kudos

Rakshit

Please check out this URL from a colleagues blog http://blogs.sybase.com/phoran/?p=491

You need to create an account on a RS, then from the RS you will be given Configuration instructions

1. What you need to create your RS Outbound Enabler

2. What you need to add to your App params to connect to your SUP through the RS

Hope this points you in the right direction

Ian

rakshit_doshi
Active Contributor
0 Kudos

Hi Ian,

I went through this document. I am searching for the code snippet for authorizing and connecting to the SUP Server through the Relay Server. Right now i am using the sybase hosted relay service but whenever i try to connect i am struck with this error "Could not connect to Server.Verifry Relay Server URL Template"

Do you have the code for how to register the android device through relay server on the SUP Server.

Ian_Thain
Developer Advocate
Developer Advocate
0 Kudos

Rakshit

As far as I know the code is the connection to the SUP server, but in the Application parameters/setting you will be specifying those that are supplied via the RS

Ian

rakshit_doshi
Active Contributor
0 Kudos

Ya Ian,

I get ur point.. What you want to say is instead of the Server name i shud provide "relayserver.sybase.com " and Port number shud be 80. But after doing that m still nt able to authenticate the user even after giving the Farm id in the connection properties still getting the same error.Did u ever get this kind of error? If yes how did you solve it?

Ian_Thain
Developer Advocate
Developer Advocate
0 Kudos

Rakshit

yes Server Name: http://relayserver.sybase.com Server Port: 80 Company ID: whatever was in the -f

Username: what you specified in the SUP admin console  Activation code: what you specified innthe SUP admin console

Did you configure your RSOE on your SUP server & restart it?

Ian

rakshit_doshi
Active Contributor
0 Kudos

Ian,

I did all those then also getting the error.. Thats why i was asking for the code snippet..Do u have any..Can you kindly post it.

Ian_Thain
Developer Advocate
Developer Advocate
0 Kudos

I have coded against RS and SUP in Objective-C, not Java.

If you take RS out of the equation, can you connect to SUP with your Android App?

Ian

_IvanFemia_
Active Contributor
0 Kudos

Hi Ian,

did you share your experience with iOS and RS?

I'm really interested if you can provide also you piece of code in Objective-C

Thanks and Regards,

Ivan

Ian_Thain
Developer Advocate
Developer Advocate
0 Kudos

Ivan

If you look at the iOS/Objective-C tutorials, its the same code, with or without RS. The difference is in the setting in the App's Preferences

Ian

rajesh_kumar145
Explorer
0 Kudos

Hi , can anyone help me.

I want a complete running code in abap2xlsx.The code should have atleast one select statement and the result should be displayed in excel sheet.

I will be really happy if u will answer this question.