Groups | Blog | Home
all groups > sql server replication > july 2006 >

sql server replication : Web Synchronisation for Merge Replication Error


Hilary Cotter
7/7/2006 12:00:00 AM
what happens if you do the following from the subscriber?

https://Raff.domain.com/caroltesting/replisapi.dll"

and

https://Raff.domain.com/caroltesting/replisapi.dll?diag

Note that your url must be crafted to match the certificate.



--
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.

This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.

Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html

Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com



[quoted text, click to view]

carol
7/7/2006 3:43:01 AM
I am trying to deploy web synchronisation between server and client. Some
basic setting up are as following:
1. Server -- SQL 2005 Standard Edition
2. Client -- SQL 2005 Express Edition
3. Sync Type -- Merge Sync
4. Subscription Type -- Pull Subscription
5. A publication (called CarolPub) is created at the server and a
subscription is created at subscriber
6. The SSL certificate is installed and IIS, Publication are both configured
for web sync and the web sync address is:
http://Raff/caroltesting/replisapi.dll

Now, I am writing the VB.net windows application to perform the web sync.
The VB code are:
' Create a connection to the Subscriber.
Dim conn As ServerConnection = New
ServerConnection("CAROL\SUBSCRIBER_CAROL")

Dim subscription As MergePullSubscription
Dim agent As MergeSynchronizationAgent

Try
' Connect to the Subscriber.
conn.Connect()

' Define the pull subscription.
subscription = New MergePullSubscription()
subscription.ConnectionContext = conn
subscription.DatabaseName = "AAL"
subscription.PublisherName = "RAFF"
subscription.PublicationDBName = "AAL"
subscription.PublicationName = "CarolPub"

' If the pull subscription exists, then start the synchronization.
If subscription.LoadProperties() Then

' Get the agent for the subscription.
agent = subscription.SynchronizationAgent

' Check that we have enough metadata to start the agent.
If agent.PublisherSecurityMode = Nothing Then

' Set the required properties that could not be returned
' from the MSsubscription_properties table.
agent.PublisherSecurityMode = SecurityMode.Standard
agent.PublisherLogin = "sa"
agent.PublisherPassword = "carol"

agent.Distributor = "RAFF"
agent.DistributorSecurityMode = SecurityMode.Standard
agent.DistributorLogin = "sa"
agent.DistributorPassword = "carol"

' Set optional Web synchronization properties.
agent.UseWebSynchronization = True
agent.InternetUrl = webSyncUrl
agent.InternetSecurityMode = SecurityMode.Integrated
agent.InternetLogin = "carol"
agent.InternetPassword = "carol"
End If

' Enable agent logging to the console.
agent.OutputVerboseLevel = 1
agent.Output = ""

' Synchronously start the Merge Agent for the subscription.
agent.Synchronize()

Else
' ' Do something here if the pull subscription does not
exist.

MessageBox.Show(String.Format( _
"A subscription to '{0}' does not exist on {1}", _
publicationName, subscriberName))
End If

Catch ex As Exception
' Implement appropriate error handling here.

MessageBox.Show(ex.StackTrace & ", " & ex.Message)
Finally
conn.Disconnect()
End Try

When I try to run the code, it thrown me a error "A security error occured".
but if manually test that https address in IE, it works. Does anyone know
carol
7/7/2006 4:01:02 AM
The web sync URL I mentioned in the 1st post should be
"https://Raff/caroltesting/replisapi.dll"
carol
7/7/2006 4:55:02 AM
The fowllowing links from subscriber thrown me the message of "Page cannot be
displayed". I used SelfSSL at the server for testing, but it did issed to
RAFF which is my server.

Thanks!

[quoted text, click to view]
Hilary Cotter
7/7/2006 10:50:44 AM
OK it looks like you aren't connecting to the correct url. You should be
getting an access denied from the first and from the second a diagnostic
page.


--
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.

This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.

Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html

Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com



[quoted text, click to view]

carol
7/10/2006 2:58:01 AM
I've now managed to connect to diagnostic page. but the synchronisation still
seems not working due to the merge agent. the error i've got is "merge agent
cannot connect to https://........". the subscription properties at client
side shows that agent has never been run. how can I solve that problem? Thank
you very much!!

carol


[quoted text, click to view]
Mahesh [MSFT]
7/15/2006 11:32:44 AM
Carol,
Typically the security error occurs because:
1. the name on the certificate does not match the name you are using in the
InternetURL
And I mean that if you certificate does not have domain name, then
InternetURL should not have domain name. If certificate has it, InternetURL
should have it.
2. When you try the URL in IE, you should not be getting any popups (except
the Login/Pass when using Basic auth). Typically for the first time, you do
get a pop up on the subscriber when you try to connect to the URL from IE.
This is because the subscriber does not trust the certificate. You may need
to install this certificate on the subscriber as a trusted certificate.
Close IE and reopen the URL. This time you should not get the popup. Now run
the merge and it should succeed.

Hope that helps
--Mahesh

[ This posting is provided "as is" with no warranties and confers no
rights. ]


[quoted text, click to view]

AddThis Social Bookmark Button