3.在数据库上创建基本服务代理构建(单个数据库通信)

USE [MyDatabase]  

CREATE MESSAGE TYPE [//initiator] VALIDATION = WELL_FORMED_XML;
    GO

CREATE CONTRACT [//call/contract]
(
    [//initiator] SENT BY INITIATOR 
)
GO

CREATE QUEUE  InitiatorQueue;
GO

CREATE QUEUE  TargetQueue;
GO

CREATE SERVICE InitiatorService
      ON QUEUE InitiatorQueue
(
     [//call/contract]    
      
)

CREATE SERVICE TargetService
ON QUEUE TargetQueue 
(
     [//call/contract]    
      
)

GRANT SEND ON SERVICE::[InitiatorService] TO PUBLIC
GO

GRANT SEND ON SERVICE::[TargetService] TO PUBLIC
GO

我们不需要路由进行一次数据库通信。