Example: Delete Action

This topic describes sample inbound and outbound messages for the delete action in Application Integration Framework (AIF). An inbound delete action message can specify one or more records to be deleted. After the inbound message is processed, AIF generates a single outbound message that has a nearly empty <Body> tag section.

Inbound Delete Message Sample

The following inbound delete message specifies that one record is deleted from the SalesTable table. To enforce referential integrity, the system might also delete records from the child table SalesLine.

The sample XML contains no tags that are specific to this service or delete action.

<?xml version="1.0" encoding="utf-8"?>
<Envelope xmlns = "http://schemas.microsoft.com/
  dynamics/2008/01/documents/Message">
 <Header>
  <MessageId>{DD112222-0306-1220-0001-DD33444455DD}</MessageId>
  <SourceEndpointUser></SourceEndpointUser>
  <SourceEndpoint></SourceEndpoint>
  <DestinationEndpoint></DestinationEndpoint>
  <Action>http://schemas.microsoft.com/dynamics/
    2008/01/services/SalesOrderService/delete</Action>
  <ConversationId></ConversationId>
 </Header>

 <Body>
  <MessageParts xmlns = "http://schemas.microsoft.com/
    dynamics/2008/01/documents/Message">
   <EntityKeyList xmlns = "http://schemas.microsoft.com/
     dynamics/2006/02/documents/EntityKeyList">

    <EntityKey xmlns = "http://schemas.microsoft.com/
      dynamics/2006/02/documents/EntityKey">
     <KeyData>
      <KeyField>
       <Field>SalesId</Field>
       <Value>00020_036</Value>
      </KeyField>
     </KeyData>
    </EntityKey>

   </EntityKeyList>
  </MessageParts>
 </Body>
</Envelope>

Corresponding Outbound Message

The outbound delete message has a nearly empty <Body> section. The following outbound message is generated from the previous inbound message.

<?xml version="1.0" encoding="utf-8"?>
<Envelope xmlns = "http://schemas.microsoft.com/
  dynamics/2008/01/documents/Message">
 <Header>
  <MessageId>{513ACDF8-8BB9-41E2-8B26
    -48D8A0458C5B}</MessageId>
  <SourceEndpoint>Default</SourceEndpoint>
  <DestinationEndpoint>Default</DestinationEndpoint>
  <Action>http://schemas.microsoft.com/dynamics/
    2008/01/services/SalesOrderService/delete</Action>
  <RequestMessageId>{DD112222-0306-1220-0001
    -DD33444455DD}</RequestMessageId>
 </Header>

 <Body>
  <MessageParts xmlns = "http://schemas.microsoft.com/dynamics/
    2008/01/documents/Message" />
 </Body>
</Envelope>

See Also

AIF Messages