Security error for SQL Server Merge Replication in SQL 2005

  • Hi,

    We are trying to implement desktop synchronization using SQL 2005 Merge Replication. We have created the publication and configured the web synchronization. Database server and Web Server are on different machines. Snapshot folder is located on a third server.

    We have enabled Integrated authentication while configuring the replication web service.

    The web server is configured for integrated authentication.

    When we try to test the replisapi.dll using the replication web service, it prompts for user id and password. Even after entering the correct credentials , a message "You are not authorized to view the Page" is displayed after multiple iterations.

    We tried to synchronize programatically as described below.

    We have made the subscription type anonymous as we want the subscribers to be created programatically without connecting to the publisher.

    Whenever try to synchronize using the code mentioned below, we get an error message "A Security error occured" and the replication fails.

    Please let us know if we are missing anything.

    ServerConnection conn = new ServerConnection( );

    MergePullSubscription subscription;

    MergeSynchronizationAgent agent;

    // Connect to the Subscriber.

    conn.Connect();

    // Define the pull subscription.

    subscription = new MergePullSubscription();

    subscription.ConnectionContext = conn;

    subscription.DatabaseName =

    subscription.PublisherName = ;

    subscription.PublicationDBName = ;

    subscription.PublicationName = ;

    //if the pull subscription exists, then start the synchronization.

    if (subscription.LoadProperties())

    {

    // Get the agent for the subscription.

    agent = subscription.SynchronizationAgent;

    agent.SubscriptionType = SubscriptionOption.Anonymous;

    // Set the required properties that could not be returned

    // from the MSsubscription_properties table.

    agent.PublisherSecurityMode = SecurityMode.Standard;

    agent.PublisherLogin = ;

    agent.PublisherPassword = ;

    agent.DistributorSecurityMode = SecurityMode.Integrated;

    agent.Distributor = ;

    // Set optional Web synchronization properties.

    agent.UseWebSynchronization = true;

    agent.InternetUrl = "https:// /Desktop_Sync/replisapi.dll";

    agent.InternetSecurityMode = SecurityMode.Integrated;

    agent.InternetLogin = ;

    agent.InternetPassword = ;

    // Synchronously start the Merge Agent for the subscription.

    agent.Synchronize();

    The stack trace is mentioned below

    at Microsoft.SqlServer.Replication.MergeSynchronizationAgent.Run()

    at Microsoft.SqlServer.Replication.MergeSynchronizationAgent.Synchronize()

    Thanks

    RajaSekhar

Viewing 0 posts

You must be logged in to reply to this topic. Login to reply