Contracts are agreements between two Service Broker
Services and two Dialog
Conversation Endpoints
over which Conversation Endpoint, the initiator or target, can send messages of particular Message Types in a
dialog conversation. The initiator is
the Conversation Endpoint that starts a dialog conversation while the target is the Conversation Endpoint that is the
intended recipient of messages sent through that conversation. Each dialog conversation must adhere to
the rules of a Contract. Each contract contains one or more Message Types that can be used during a dialog
conversation between two Services or, when using the same Service, between two Dialog Conversation Endpoints.
Also, each Service is defined with one or more Contracts. So, there are two places where Contracts are specified:
1) when creating a Service and 2) when initiating a Dialog Conversation. Once a Service has been created, you no
longer have to specify which Contracts that Service can use. Dialogs, on the other hand, have their associated
Contracts specified at the time they're created and, since you must first create a dialog in order to send messages
(unless you're responding to an existing dialog conversation from the Target) through it, Contracts are specified at
each creation of a new dialog conversation.