cancel
Showing results for 
Search instead for 
Did you mean: 

SUPPersistenceException on Subscribe & Sync: Sync Failed: -1497 (ERROR): Parameter 2: 3002

Former Member
0 Kudos

Hi All,

We are building a test iOS app on SUP 2.1.3 via Relay Server.

The application seems to register sucessfully in SCC. However during subscription we are getting Sync failed exception.

Following is the code we have used to subscribe to SUP

#define SERVER_NAME @"Relay_Server.com"

#define MBS_SERVER_PORT 443

#define RBS_SERVER_PORT 443

#define RBS_FARM_ID @"FarmID.RBS"

#define MBS_FARM_ID @"FarmID.MBS"

#define APP_IDENTIFIER @"MBOSample"

#define MBS_URL_SUFFIX @"/ias_relay_server/client/rs_client.dll"

#define RBS_URL_SUFFIX @"trusted_certificates=-.test.com;compression=zlib;url_suffix=ias_relay_server/client/rs_client.dll/FarmID.RBS;"

#define DOMAIN_NAME @"default"

-(void)onConnectSuccess:(NSNotification *)obj
{
    // Connection to the server was made, so log in.
    // See [CallbackHandler onLoginSuccess] and [CallbackHandler onLoginFailure]. One of those
    // callbacks will be called at some point in the future.
    [[NSNotificationCenter defaultCenter] removeObserver:self name:ON_CONNECT_SUCCESS object:nil];
    [[NSNotificationCenter defaultCenter] removeObserver:self name:ON_CONNECT_FAILURE object:nil];
   
    SUPDataVault *testHarnessVault = nil;
   
    SUPConnectionProfile *sp = [MBOSampleMBOSampleDB getSynchronizationProfile];
   
   
    NSLog(@"SUPUser Id:%@", self.supUser);
   
   
    [sp setAsyncReplay:YES];
    [sp setUser:self.supUser];
    [sp setPassword:self.supPassword];
    [sp setServerName:SERVER_NAME];
    [sp setPortNumber:RBS_SERVER_PORT];
    [sp setDomainName:DOMAIN_NAME];
    [sp setNetworkProtocol:@"https"];
   
   
    NSString *networkParamsKey = RBS_URL_SUFFIX;
    NSLog (@"URL SUFFIX:%@", RBS_URL_SUFFIX);
    [sp setNetworkStreamParams:RBS_URL_SUFFIX];
    [sp enableTrace:YES withPayload:YES];
  
   
    @try
    {
        [MBOSampleMBOSampleDB subscribe];
    }
    @catch (SUPPersistenceException *e)
    {
        NSLog (@"SUPPersistenceException on Subscribe:Subscribe & Sync:%@: %@", [e name], [e reason] );
       
    }
    @catch (NSException *exceptionI)
    {
        NSLog (@"Exception on Subscribe in onConnectSuccess:Subscribe & Sync:%@: %@", [exceptionI name], [exceptionI reason] );
       
    }
    NSLog(@"Past Subscribe");
    @try
    {
           [MBOSampleMBOSampleDB synchronize];
    }
    @catch (NSException *exceptionI)
    {
        NSLog (@"Exception on Synchornize in onConnectSuccess:%@: %@", [exceptionI name], [exceptionI reason] );
       
    }
   
    NSLog(@"Past Sync");
   
    // send the notification , so that the UI enables the Subscribe button
    NSNotification *n = [NSNotification notificationWithName:ON_LOGIN_SUCCESS object:nil];
    [[NSNotificationCenter defaultCenter] postNotification:n];
}


Accepted Solutions (0)

Answers (1)

Answers (1)

markteichmann
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Siddharth,

did you find the solution for your problem? Since you are on Version 2.1.3 iOS is using replication based synch (RBS) therefore instead of subscribe just do a synchronize then it should work.