-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path57_send_request.sql
32 lines (29 loc) · 1 KB
/
57_send_request.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*************************************************************************
- Sending a message through our wrapper
**************************************************************************/
use ServiceBrokerBeginner
go
/* prepare xml message for the request */
declare @message_body xml =
(
select
[RequestMessage/@DebugLevel] = 1
,[RequestMessage/@TestMode] = 0
,[RequestMessage/senderId] = 'brain246'
,[RequestMessage/senderName] = 'Thomas Totter'
,[RequestMessage/MessageText] = 'Help me, please!'
,[RequestMessage/Comment] = 'This is very urgent'
for xml path('msg'), type
)
/* send a message/request */
execute dbo.SendBrokerMessage
@fromservice = N'InitiatorService'
,@Toservice = N'TargetService'
,@contract = N'MessageContract'
,@MessageType = N'RequestMessage'
,@message_body = @message_body;
/*
since we already specified automated processing on both sides,
the rest of the workflow should be completed without our doing
check the queues and endpoints
*/