/** * Send a RetrieveEntity request to the Dynamics CRM server and return the results as raw XML * This is particularly useful when debugging the responses from the server * * @param string $entityType the LogicalName of the Entity to be retrieved (Incident, Account etc.) * * @return string the raw XML returned by the server, including all SOAP Envelope, Header and Body data. */ public function retrieveEntityRaw($entityType, $entityId = null, $entityFilters = null, $showUnpublished = false) { /* Send the sequrity request and get a security token */ $securityToken = $this->authentication->getOrganizationSecurityToken(); /* Generate the XML for the Body of a RetrieveEntity request */ $executeNode = SoapRequestsGenerator::generateRetrieveEntityRequest($entityType, $entityId, $entityFilters, $showUnpublished); /* Turn this into a SOAP request, and send it */ $retrieveEntityRequest = $this->generateSoapRequest($this->settings->organizationUrl, $this->soapActions->getSoapAction('organization', 'Execute'), $securityToken, $executeNode); $soapResponse = self::getSoapResponse($this->settings->organizationUrl, $retrieveEntityRequest); return $soapResponse; }