Ejemplo n.º 1
0
        internal void InstallIntegration(string integrationKey, string apiUrl, string webName, string webUrl,
                                         Guid integrationId, string objectName, bool incomingEnabled,
                                         bool outgoingEnabled, bool allowDeletion)
        {
            _sfMedadataService.InstallTrigger(objectName);
            _sfMedadataService.ConfigureRemoteSite(apiUrl);

            var parameters = new Dictionary <string, object>
            {
                { "key", integrationKey },
                { "intId", integrationId.ToString() },
                { "objectName", objectName },
                { "apiUrl", apiUrl },
                { "webName", webName },
                { "webUrl", webUrl },
                { "incomingEnabled", incomingEnabled },
                { "outgoingEnabled", outgoingEnabled },
                { "allowDeletion", allowDeletion }
            };

            SalesforceServiceResponse response = MakeRequest(INTEGRATION_SERVICE_URL, "POST", parameters);

            if (!response.Success)
            {
                throw new Exception(response.Message);
            }
        }
Ejemplo n.º 2
0
        internal void UninstallIntegration(string integrationKey, string objectName)
        {
            _sfMedadataService.UninstallTrigger(objectName);

            SalesforceServiceResponse response = MakeRequest(INTEGRATION_SERVICE_URL + integrationKey, "DELETE", null);

            if (!response.Success)
            {
                throw new Exception(response.Message);
            }
        }
Ejemplo n.º 3
0
        internal bool IsSyncEnabled()
        {
            SalesforceServiceResponse response = MakeRequest(INTEGRATION_SERVICE_URL + "syncstatus", "GET", null);

            if (!response.Success)
            {
                throw new Exception(response.Message);
            }

            return(response.Message.Equals("Online"));
        }