I am trying to send a message between to SQL Server 2005 instances on two different machines. I have checked all my routes and all my objects appear to be setup correctly. However, when running Profiler on the target machine, I receive the "This message has been dropped because the TO service could not be found. Service name: "[tcp://mydomain.com/TARGET/MyService]". Message origin: "Transport". This is my activated stored procedure that is sending the message to the target service. I am using certificate security. Any help appreciated....
CREATE
PROCEDURE [usp_ProcessMessage]AS
BEGIN
SET NOCOUNT ON; DECLARE @conversation_handle uniqueidentifier DECLARE @message_body AS VARBINARY(MAX) WHILE (1=1) BEGIN BEGIN TRANSACTION; WAITFOR(RECEIVE TOP (1)@conversation_handle
= conversation_handle,@message_body
= message_body FROM [tcp://mydomain.com/INITIATE/MyQueue] ), TIMEOUT 1000; IF (@@ROWCOUNT = 0) BEGIN COMMIT; BREAK; END END CONVERSATION @conversation_handle IF @message_body IS NOT NULL BEGIN BEGIN DIALOG CONVERSATION @conversation_handle FROM SERVICE [tcp://mydomain.com/INITIATE/MyService] TO SERVICE '[tcp://mydomain.com/TARGET/MyService]' ON CONTRACT [tcp://mydomain.com/INITIATE/MyMessage/v1.0] WITH ENCRYPTION = ON, LIFETIME = 600; SEND ON CONVERSATION @conversation_handle MESSAGE TYPE [tcp://mydomain.com/TARGET/VisitMessage] (@message_body); END COMMIT; ENDEND
GO
My endpoints are created like so:
CREATE
ENDPOINT MyEndpoint STATE = STARTED AS TCP ( LISTENER_PORT = 4022 ) FOR SERVICE_BROKER (AUTHENTICATION = CERTIFICATE MasterCertificate)GO
GRANT
CONNECT TO CertOwnerGRANT
CONNECT ON ENDPOINT::MyEndpoint TO CertOwnerGO
And my routes like so:
GRANT
SEND ON SERVICE::[tcp://mydomain.com/INITIATE/MyService] TO CertOwnerGO
CREATE
REMOTE SERVICE BINDING [MyCertificateBinding] TO SERVICE '[tcp://mydomain.com/TARGET/MyService]' WITH USER = CertOwner, ANONYMOUS=OFFCREATE
ROUTE [tcp://mydomain.com/INITIATE/MyRoute] WITH SERVICE_NAME = '[tcp://mydomain.com/TARGET/MyService]', BROKER_INSTANCE = N'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', ADDRESS = N'TCP://xxx.xx.xx.xx:4022'GO