Understanding the Outbound Messaging WSDL

The rest of this topic examines relevant sections of the outbound messaging WSDL. Your WSDL can differ, depending on the choices you made when you set up outbound messaging for a particular event on a particular object.

notifications() 

This section defines the notifications() call, which creates an outbound message containing specified fields and values for a particular object or objects, and sends the values to a specified endpoint URL:

1<schema elementFormDefault="qualified" xmlns="http://www.w3.org/2001/XMLSchema" 
2         targetNamespace="http://soap.sforce.com/2005/09/outbound">
3            <import namespace="urn:enterprise.soap.sforce.com" />
4            <import namespace="urn:sobject.enterprise.soap.sforce.com" />
5    
6            <element name="notifications">
7                <complexType> 
8                    <sequence> 
9                        <element name="OrganizationId" type="ent:ID" />
10                        <element name="ActionId" type="ent:ID" />
11                        <element name="SessionId" type="xsd:string" nillable="true" />
12                        <element name="EnterpriseUrl" type="xsd:string" />
13                        <element name="PartnerUrl" type="xsd:string" />
14                        <element name="Notification" maxOccurs="100" 
15                          type="tns:OpportunityNotification" />
16                    </sequence> 
17                </complexType> 
18            </element>
19        </schema>

Use this table to understand the elements named in the notifications method definition:

NameTypeDescription
OrganizationIdIDID of the organization sending the message.
ActionIdstringThe workflow rule (action) that triggers the message.
SessionIdstringOptional, a session ID to be used by endpoint URL client that is responding to the outbound message. It’s used by the receiving code to make calls back to Salesforce.
EnterpriseURLstringURL to use to make API calls back to Salesforce using the enterprise WSDL.
PartnerURLstringURL to use to make API calls back to Salesforce using the partner WSDL.
NotificationNotificationDefined in the next section, contains the object datatype and its Id, for example OpportunityNotification or ContactNotification.

The Notification datatype is defined in the WSDL. In the following example, a Notification for opportunities is defined, based on the Notification entry of the notifications() call definition:

1<complexType name="OpportunityNotification">
2                <sequence>
3                    <element name="Id" type="ent:ID" />
4                    <element name="sObject" type="ens:Opportunity" />
5                </sequence>
6            </complexType>

Each object element (in our example, opportunities) contains the subset of the fields that you selected when you created the outbound message. Each message Notification also has the object ID. Use the object ID to track redelivery attempts of notifications you’ve already processed.

notificationsResponse 

This element is the schema for sending an acknowledgment (ack) response to Salesforce.

1<element name="notificationsResponse">
2                <complexType>
3                    <sequence>
4                        <element name="Ack" type="xsd:boolean" />
5                    </sequence>
6                </complexType>
7            </element> //This section is the last in the types definition section.

You acknowledge all notifications in the message if there’s more than one.