Publishing Platform Events using SoapUI

Here lets us discuss how to publish the Salesforce platform events using the SoapUI.Use platform events to deliver secure and scalable custom notifications within Salesforce or from external sources. Platform events are part of Salesforce’s enterprise messaging platform. The platform provides an event-driven messaging architecture to enable apps to communicate inside and outside of Salesforce. Here is the simple platform event object 

1. Get  Enterprise WSDL

Here we’re using the enterprise WSDL to explore SOAP API. To get the WSDL, from Setup, enter API in the Quick Find box, then select API. On the API WSDL page, click Generate Enterprise the WSDL file to the local repository.

2. Create a Project in SoapUI 

File menu, select New SOAP Project and create a new project as shown below.

3. Get SessionId

In SoapUI, scroll down to the login operation. Expand it, and then double-click Request 1. A sample SOAP login request appears.

here is the soapUI request you need to send it as part of the request. after successfully login request, you will get the session id and instance URL.

<soapenv:Envelope xmlns:soapenv="" xmlns:urn="">

4. Create a Platform Event 

now use create operation to create a platform event as shown below

Here is the sample request that will be used to create a salesforce platform event. once you execute the request you will return the response with the platform event id

<soapenv:Envelope xmlns:soapenv=""
         <!--Zero or more repetitions:-->
         <urn:sObjects xsi:type="Shipments__e" 
			<urn:fieldsToNull xsi:nil="true"/>
			<urn:Id xsi:nil="true"/>

5.Subscribe to platform events 

Here is the simple trigger that will subscribe to platform events and create a simple task to the user.

trigger Subscribe on Shipments__e (after insert) {
    List<Task> tasks = new List<Task>();
    for (Shipments__e event : Trigger.New) {
        if (event.Delivered__c == true) {
            Task t = new Task();
            t.Priority = 'Medium';
            t.Subject = 'Follow up on shipped order ' + event.Shipment_Number__c;
            t.OwnerId = UserInfo.getUserId();
    if (tasks.size() > 0) {
        insert tasks;