I have an API sending me webhook data in XML and not JSON

I have an API that sends me a webhook but its in XML like this.

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <soapenv:Body>
  <notifications xmlns="http://soap.sforce.com/2005/09/outbound">
   <OrganizationId>00D3K5550000TAdUAM</OrganizationId>
   <ActionId>04k3K55500000lWQAQ</ActionId>
   <SessionId xsi:nil="true"/>
   <EnterpriseUrl>https://example--uat.my.salesforce.com/services/Soap/c/53.0/00D3K5550000TAd</EnterpriseUrl>
   <PartnerUrl>https://example--uat.my.salesforce.com/services/Soap/u/53.0/00D3K5550000TAd</PartnerUrl>
   <Notification>
    <Id>04l3K555003yhH0QAI</Id>
    <sObject xsi:type="sf:ServiceAppointment" xmlns:sf="urn:sobject.enterprise.soap.sforce.com">
     <sf:Id>08p3K555000Wf9MQAS</sf:Id>
     <sf:AppointmentNumber>SA-5338879</sf:AppointmentNumber>
     <sf:IsDeleted>false</sf:IsDeleted>
     <sf:PostalCode>30157</sf:PostalCode>
     <sf:SchedEndTime>2021-10-04T20:30:00.000Z</sf:SchedEndTime>
     <sf:SchedStartTime>2021-10-04T18:00:00.000Z</sf:SchedStartTime>
     <sf:Scheduled_Start_Lock__c>2021-10-04</sf:Scheduled_Start_Lock__c>
     <sf:ServiceTerritoryId>0Hh6f555000blUgCAI</sf:ServiceTerritoryId>
     <sf:Status>None</sf:Status>
     <sf:Verified__c>false</sf:Verified__c>
    </sObject>
   </Notification>
   <Notification>
    <Id>04l3K555003yhGyQAI</Id>
    <sObject xsi:type="sf:ServiceAppointment" xmlns:sf="urn:sobject.enterprise.soap.sforce.com">
     <sf:Id>08p3K555000Wf9LQAS</sf:Id>
     <sf:AppointmentNumber>SA-5338878</sf:AppointmentNumber>
     <sf:IsDeleted>false</sf:IsDeleted>
     <sf:PostalCode>30157</sf:PostalCode>
     <sf:ServiceTerritoryId>0Hh6f555000blUgCAI</sf:ServiceTerritoryId>
     <sf:Status>None</sf:Status>
     <sf:Verified__c>false</sf:Verified__c>
    </sObject>
   </Notification>
  </notifications>
 </soapenv:Body>
</soapenv:Envelope>

Just trying to figure out the best way to get that data into my database, its a NodeJS Docker project.

Even if I can not parse the XML, how would i get the entire response from $_POST as a blob.

Anyone got any ideas please

Community Page
Last updated: