camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lburgazz...@apache.org
Subject [2/2] camel git commit: CAMEL-10482: ServiceNow : add an option to set inbound and outbound models
Date Wed, 16 Nov 2016 14:07:39 GMT
CAMEL-10482: ServiceNow : add an option to set inbound and outbound models


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/0902c25e
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/0902c25e
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/0902c25e

Branch: refs/heads/master
Commit: 0902c25e0c22a147a1083d854dfea80292a7fa5c
Parents: ce23658
Author: lburgazzoli <lburgazzoli@gmail.com>
Authored: Wed Nov 16 15:05:15 2016 +0100
Committer: lburgazzoli <lburgazzoli@gmail.com>
Committed: Wed Nov 16 15:06:27 2016 +0100

----------------------------------------------------------------------
 .../ServiceNowComponentConfiguration.java       | 421 +++++++++++++++++++
 .../src/main/docs/servicenow-component.adoc     |   8 +-
 .../servicenow/AbstractServiceNowProcessor.java | 113 +++--
 .../servicenow/ServiceNowComponent.java         |  83 ++--
 .../servicenow/ServiceNowConfiguration.java     | 144 +++++--
 .../servicenow/ServiceNowConstants.java         |   3 +
 .../fuji/FujiServiceNowAggregateProcessor.java  |   4 +-
 .../fuji/FujiServiceNowImportSetProcessor.java  |  10 +-
 .../releases/fuji/FujiServiceNowProcessor.java  |  13 +-
 .../fuji/FujiServiceNowTableProcessor.java      |  30 +-
 .../HelsinkiServiceNowAggregateProcessor.java   |   4 +-
 .../HelsinkiServiceNowAttachmentProcessor.java  |  13 +-
 .../HelsinkiServiceNowImportSetProcessor.java   |  11 +-
 .../HelsinkiServiceNowMiscProcessor.java        |   8 +-
 .../HelsinkiServiceNowScorecardProcessor.java   |   4 +-
 ...iServiceNowServiceCatalogCartsProcessor.java |  24 +-
 ...iceNowServiceCatalogCategoriesProcessor.java |   4 +-
 ...iServiceNowServiceCatalogItemsProcessor.java |  20 +-
 ...lsinkiServiceNowServiceCatalogProcessor.java |   8 +-
 .../HelsinkiServiceNowTableProcessor.java       |  29 +-
 .../servicenow/ServiceNowImportSetTest.java     | 137 ++++++
 .../component/servicenow/ServiceNowTest.java    |  41 +-
 22 files changed, 926 insertions(+), 206 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/0902c25e/components-starter/camel-servicenow-starter/src/main/java/org/apache/camel/component/servicenow/springboot/ServiceNowComponentConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-servicenow-starter/src/main/java/org/apache/camel/component/servicenow/springboot/ServiceNowComponentConfiguration.java b/components-starter/camel-servicenow-starter/src/main/java/org/apache/camel/component/servicenow/springboot/ServiceNowComponentConfiguration.java
index 76e8d4a..c9f7b2a 100644
--- a/components-starter/camel-servicenow-starter/src/main/java/org/apache/camel/component/servicenow/springboot/ServiceNowComponentConfiguration.java
+++ b/components-starter/camel-servicenow-starter/src/main/java/org/apache/camel/component/servicenow/springboot/ServiceNowComponentConfiguration.java
@@ -16,7 +16,12 @@
  */
 package org.apache.camel.component.servicenow.springboot;
 
+import java.util.Map;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.apache.camel.component.servicenow.ServiceNowComponent;
+import org.apache.camel.component.servicenow.ServiceNowRelease;
 import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.boot.context.properties.NestedConfigurationProperty;
 
 /**
  * The servicenow component is used to integrate Camel with ServiceNow cloud
@@ -28,6 +33,10 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
 public class ServiceNowComponentConfiguration {
 
     /**
+     * The ServiceNow default configuration
+     */
+    private ServiceNowConfigurationNestedConfiguration configuration;
+    /**
      * The ServiceNow REST API url
      */
     private String apiUrl;
@@ -52,6 +61,15 @@ public class ServiceNowComponentConfiguration {
      */
     private String oauthTokenUrl;
 
+    public ServiceNowConfigurationNestedConfiguration getConfiguration() {
+        return configuration;
+    }
+
+    public void setConfiguration(
+            ServiceNowConfigurationNestedConfiguration configuration) {
+        this.configuration = configuration;
+    }
+
     public String getApiUrl() {
         return apiUrl;
     }
@@ -99,4 +117,407 @@ public class ServiceNowComponentConfiguration {
     public void setOauthTokenUrl(String oauthTokenUrl) {
         this.oauthTokenUrl = oauthTokenUrl;
     }
+
+    public static class ServiceNowConfigurationNestedConfiguration {
+        public static final Class CAMEL_NESTED_CLASS = org.apache.camel.component.servicenow.ServiceNowConfiguration.class;
+        /**
+         * ServiceNow user account name, MUST be provided
+         */
+        private String userName;
+        /**
+         * The ServiceNow REST API url
+         */
+        private String apiUrl;
+        /**
+         * ServiceNow account password, MUST be provided
+         */
+        private String password;
+        /**
+         * OAuth2 ClientID
+         */
+        private String oauthClientId;
+        /**
+         * OAuth2 ClientSecret
+         */
+        private String oauthClientSecret;
+        /**
+         * OAuth token Url
+         */
+        private String oauthTokenUrl;
+        /**
+         * The default resource, can be overridden by header
+         * CamelServiceNowResource
+         */
+        private String resource;
+        /**
+         * The default table, can be overridden by header CamelServiceNowTable
+         */
+        private String table;
+        /**
+         * True to exclude Table API links for reference fields (default: false)
+         */
+        private Boolean excludeReferenceLink;
+        /**
+         * True to suppress auto generation of system fields (default: false)
+         */
+        private Boolean suppressAutoSysField;
+        /**
+         * Set this value to true to remove the Link header from the response.
+         * The Link header allows you to request additional pages of data when
+         * the number of records matching your query exceeds the query limit
+         */
+        private Boolean suppressPaginationHeader;
+        /**
+         * Set this parameter to true to return all scores for a scorecard. If a
+         * value is not specified, this parameter defaults to false and returns
+         * only the most recent score value.
+         */
+        private Boolean includeScores;
+        /**
+         * Set this parameter to true to always return all available aggregates
+         * for an indicator, including when an aggregate has already been
+         * applied. If a value is not specified, this parameter defaults to
+         * false and returns no aggregates.
+         */
+        private Boolean includeAggregates;
+        /**
+         * Set this parameter to true to return all available breakdowns for an
+         * indicator. If a value is not specified, this parameter defaults to
+         * false and returns no breakdowns.
+         */
+        private Boolean includeAvailableBreakdowns;
+        /**
+         * Set this parameter to true to return all available aggregates for an
+         * indicator when no aggregate has been applied. If a value is not
+         * specified, this parameter defaults to false and returns no
+         * aggregates.
+         */
+        private Boolean includeAvailableAggregates;
+        /**
+         * Set this parameter to true to return all notes associated with the
+         * score. The note element contains the note text as well as the author
+         * and timestamp when the note was added.
+         */
+        private Boolean includeScoreNotes;
+        /**
+         * Set this parameter to true to return only scorecards that are
+         * favorites of the querying user.
+         */
+        private Boolean favorites;
+        /**
+         * Set this parameter to true to return only scorecards for key
+         * indicators.
+         */
+        private Boolean key;
+        /**
+         * Set this parameter to true to return only scorecards that have a
+         * target.
+         */
+        private Boolean target;
+        /**
+         * Set this parameter to true to return only scorecards where the
+         * indicator Display field is selected. Set this parameter to all to
+         * return scorecards with any Display field value. This parameter is
+         * true by default.
+         */
+        private String display = "true";
+        /**
+         * Enter the maximum number of scorecards each query can return. By
+         * default this value is 10, and the maximum is 100.
+         */
+        private Integer perPage;
+        /**
+         * Specify the value to use when sorting results. By default, queries
+         * sort records by value.
+         */
+        private String sortBy;
+        /**
+         * Specify the sort direction, ascending or descending. By default,
+         * queries sort records in descending order. Use sysparm_sortdir=asc to
+         * sort in ascending order.
+         */
+        private String sortDir;
+        /**
+         * Return the display value (true), actual value (false), or both (all)
+         * for reference fields (default: false)
+         */
+        private String displayValue = "false";
+        /**
+         * True to set raw value of input fields (default: false)
+         */
+        private Boolean inputDisplayValue;
+        /**
+         * Defines the request model
+         */
+        private Map requestModels;
+        /**
+         * Sets Jackson's ObjectMapper to use for request/reply
+         */
+        @NestedConfigurationProperty
+        private ObjectMapper mapper;
+        /**
+         * The ServiceNow release to target, default to Helsinki See
+         * https://docs.servicenow.com
+         */
+        private ServiceNowRelease release = ServiceNowRelease.HELSINKI;
+        /**
+         * Gets only those categories whose parent is a catalog.
+         */
+        private Boolean topLevelOnly;
+        private Map models;
+        /**
+         * Defines the response model
+         */
+        private Map responseModels;
+
+        public String getUserName() {
+            return userName;
+        }
+
+        public void setUserName(String userName) {
+            this.userName = userName;
+        }
+
+        public String getApiUrl() {
+            return apiUrl;
+        }
+
+        public void setApiUrl(String apiUrl) {
+            this.apiUrl = apiUrl;
+        }
+
+        public String getPassword() {
+            return password;
+        }
+
+        public void setPassword(String password) {
+            this.password = password;
+        }
+
+        public String getOauthClientId() {
+            return oauthClientId;
+        }
+
+        public void setOauthClientId(String oauthClientId) {
+            this.oauthClientId = oauthClientId;
+        }
+
+        public String getOauthClientSecret() {
+            return oauthClientSecret;
+        }
+
+        public void setOauthClientSecret(String oauthClientSecret) {
+            this.oauthClientSecret = oauthClientSecret;
+        }
+
+        public String getOauthTokenUrl() {
+            return oauthTokenUrl;
+        }
+
+        public void setOauthTokenUrl(String oauthTokenUrl) {
+            this.oauthTokenUrl = oauthTokenUrl;
+        }
+
+        public String getResource() {
+            return resource;
+        }
+
+        public void setResource(String resource) {
+            this.resource = resource;
+        }
+
+        public String getTable() {
+            return table;
+        }
+
+        public void setTable(String table) {
+            this.table = table;
+        }
+
+        public Boolean getExcludeReferenceLink() {
+            return excludeReferenceLink;
+        }
+
+        public void setExcludeReferenceLink(Boolean excludeReferenceLink) {
+            this.excludeReferenceLink = excludeReferenceLink;
+        }
+
+        public Boolean getSuppressAutoSysField() {
+            return suppressAutoSysField;
+        }
+
+        public void setSuppressAutoSysField(Boolean suppressAutoSysField) {
+            this.suppressAutoSysField = suppressAutoSysField;
+        }
+
+        public Boolean getSuppressPaginationHeader() {
+            return suppressPaginationHeader;
+        }
+
+        public void setSuppressPaginationHeader(Boolean suppressPaginationHeader) {
+            this.suppressPaginationHeader = suppressPaginationHeader;
+        }
+
+        public Boolean getIncludeScores() {
+            return includeScores;
+        }
+
+        public void setIncludeScores(Boolean includeScores) {
+            this.includeScores = includeScores;
+        }
+
+        public Boolean getIncludeAggregates() {
+            return includeAggregates;
+        }
+
+        public void setIncludeAggregates(Boolean includeAggregates) {
+            this.includeAggregates = includeAggregates;
+        }
+
+        public Boolean getIncludeAvailableBreakdowns() {
+            return includeAvailableBreakdowns;
+        }
+
+        public void setIncludeAvailableBreakdowns(
+                Boolean includeAvailableBreakdowns) {
+            this.includeAvailableBreakdowns = includeAvailableBreakdowns;
+        }
+
+        public Boolean getIncludeAvailableAggregates() {
+            return includeAvailableAggregates;
+        }
+
+        public void setIncludeAvailableAggregates(
+                Boolean includeAvailableAggregates) {
+            this.includeAvailableAggregates = includeAvailableAggregates;
+        }
+
+        public Boolean getIncludeScoreNotes() {
+            return includeScoreNotes;
+        }
+
+        public void setIncludeScoreNotes(Boolean includeScoreNotes) {
+            this.includeScoreNotes = includeScoreNotes;
+        }
+
+        public Boolean getFavorites() {
+            return favorites;
+        }
+
+        public void setFavorites(Boolean favorites) {
+            this.favorites = favorites;
+        }
+
+        public Boolean getKey() {
+            return key;
+        }
+
+        public void setKey(Boolean key) {
+            this.key = key;
+        }
+
+        public Boolean getTarget() {
+            return target;
+        }
+
+        public void setTarget(Boolean target) {
+            this.target = target;
+        }
+
+        public String getDisplay() {
+            return display;
+        }
+
+        public void setDisplay(String display) {
+            this.display = display;
+        }
+
+        public Integer getPerPage() {
+            return perPage;
+        }
+
+        public void setPerPage(Integer perPage) {
+            this.perPage = perPage;
+        }
+
+        public String getSortBy() {
+            return sortBy;
+        }
+
+        public void setSortBy(String sortBy) {
+            this.sortBy = sortBy;
+        }
+
+        public String getSortDir() {
+            return sortDir;
+        }
+
+        public void setSortDir(String sortDir) {
+            this.sortDir = sortDir;
+        }
+
+        public String getDisplayValue() {
+            return displayValue;
+        }
+
+        public void setDisplayValue(String displayValue) {
+            this.displayValue = displayValue;
+        }
+
+        public Boolean getInputDisplayValue() {
+            return inputDisplayValue;
+        }
+
+        public void setInputDisplayValue(Boolean inputDisplayValue) {
+            this.inputDisplayValue = inputDisplayValue;
+        }
+
+        public Map getRequestModels() {
+            return requestModels;
+        }
+
+        public void setRequestModels(Map requestModels) {
+            this.requestModels = requestModels;
+        }
+
+        public ObjectMapper getMapper() {
+            return mapper;
+        }
+
+        public void setMapper(ObjectMapper mapper) {
+            this.mapper = mapper;
+        }
+
+        public ServiceNowRelease getRelease() {
+            return release;
+        }
+
+        public void setRelease(ServiceNowRelease release) {
+            this.release = release;
+        }
+
+        public Boolean getTopLevelOnly() {
+            return topLevelOnly;
+        }
+
+        public void setTopLevelOnly(Boolean topLevelOnly) {
+            this.topLevelOnly = topLevelOnly;
+        }
+
+        public Map getModels() {
+            return models;
+        }
+
+        public void setModels(Map models) {
+            this.models = models;
+        }
+
+        public Map getResponseModels() {
+            return responseModels;
+        }
+
+        public void setResponseModels(Map responseModels) {
+            this.responseModels = responseModels;
+        }
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/0902c25e/components/camel-servicenow/src/main/docs/servicenow-component.adoc
----------------------------------------------------------------------
diff --git a/components/camel-servicenow/src/main/docs/servicenow-component.adoc b/components/camel-servicenow/src/main/docs/servicenow-component.adoc
index 7d15c0b..5ef7483 100644
--- a/components/camel-servicenow/src/main/docs/servicenow-component.adoc
+++ b/components/camel-servicenow/src/main/docs/servicenow-component.adoc
@@ -36,7 +36,7 @@ Options
 
 
 // component options: START
-The ServiceNow component supports 6 options which are listed below.
+The ServiceNow component supports 7 options which are listed below.
 
 
 
@@ -44,6 +44,7 @@ The ServiceNow component supports 6 options which are listed below.
 [width="100%",cols="2,1m,7",options="header"]
 |=======================================================================
 | Name | Java Type | Description
+| configuration | ServiceNowConfiguration | The ServiceNow default configuration
 | apiUrl | String | The ServiceNow REST API url
 | userName | String | ServiceNow user account name
 | password | String | ServiceNow account password
@@ -56,7 +57,7 @@ The ServiceNow component supports 6 options which are listed below.
 
 
 // endpoint options: START
-The ServiceNow component supports 31 endpoint options which are listed below:
+The ServiceNow component supports 32 endpoint options which are listed below:
 
 {% raw %}
 [width="100%",cols="2,1,1m,1m,5",options="header"]
@@ -74,10 +75,11 @@ The ServiceNow component supports 31 endpoint options which are listed below:
 | includeScores | producer |  | Boolean | Set this parameter to true to return all scores for a scorecard. If a value is not specified this parameter defaults to false and returns only the most recent score value.
 | inputDisplayValue | producer |  | Boolean | True to set raw value of input fields (default: false)
 | key | producer |  | Boolean | Set this parameter to true to return only scorecards for key indicators.
-| models | producer |  | String | Defines the default model to use for a table
 | perPage | producer | 10 | Integer | Enter the maximum number of scorecards each query can return. By default this value is 10 and the maximum is 100.
 | release | producer | HELSINKI | ServiceNowRelease | The ServiceNow release to target default to Helsinki See https://docs.servicenow.com
+| requestModels | producer |  | String | Defines the request model
 | resource | producer |  | String | The default resource can be overridden by header CamelServiceNowResource
+| responseModels | producer |  | String | Defines the response model
 | sortBy | producer |  | String | Specify the value to use when sorting results. By default queries sort records by value.
 | sortDir | producer |  | String | Specify the sort direction ascending or descending. By default queries sort records in descending order. Use sysparm_sortdir=asc to sort in ascending order.
 | suppressAutoSysField | producer |  | Boolean | True to suppress auto generation of system fields (default: false)

http://git-wip-us.apache.org/repos/asf/camel/blob/0902c25e/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/AbstractServiceNowProcessor.java
----------------------------------------------------------------------
diff --git a/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/AbstractServiceNowProcessor.java b/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/AbstractServiceNowProcessor.java
index 56183b4..351eaec 100644
--- a/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/AbstractServiceNowProcessor.java
+++ b/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/AbstractServiceNowProcessor.java
@@ -18,6 +18,8 @@ package org.apache.camel.component.servicenow;
 
 import java.io.IOException;
 import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import javax.ws.rs.core.HttpHeaders;
@@ -53,10 +55,10 @@ public abstract class AbstractServiceNowProcessor implements Processor {
         this.dispatchers = new ArrayList<>();
     }
 
-    protected AbstractServiceNowProcessor setBodyAndHeaders(Message message, Class<?> model, Response response) throws Exception {
+    protected AbstractServiceNowProcessor setBodyAndHeaders(Message message, Class<?> responseModel, Response response) throws Exception {
         if (response != null) {
-            setHeaders(message, model, response);
-            setBody(message, model, response);
+            setHeaders(message, responseModel, response);
+            setBody(message, responseModel, response);
         }
 
         return this;
@@ -78,7 +80,7 @@ public abstract class AbstractServiceNowProcessor implements Processor {
     // *********************************
 
 
-    protected AbstractServiceNowProcessor setHeaders(Message message, Class<?> model, Response response) throws Exception {
+    protected AbstractServiceNowProcessor setHeaders(Message message, Class<?> responseModel, Response response) throws Exception {
         List<String> links = response.getStringHeaders().get(HttpHeaders.LINK);
         if (links != null) {
             for (String link : links) {
@@ -88,8 +90,8 @@ public abstract class AbstractServiceNowProcessor implements Processor {
                 }
 
                 // Sanitize parts
-                String uri = ObjectHelper.between(parts[0], "<", ">");
-                String rel = StringHelper.removeQuotes(ObjectHelper.after(parts[1], "="));
+                String uri = StringHelper.between(parts[0], "<", ">");
+                String rel = StringHelper.removeQuotes(StringHelper.after(parts[1], "="));
 
                 Map<String, Object> query = URISupport.parseQuery(uri);
                 Object offset = query.get(ServiceNowParams.SYSPARM_OFFSET.getId());
@@ -126,8 +128,9 @@ public abstract class AbstractServiceNowProcessor implements Processor {
         copyHeader(response, HttpHeaders.CONTENT_TYPE, message, ServiceNowConstants.CONTENT_TYPE);
         copyHeader(response, HttpHeaders.CONTENT_ENCODING, message, ServiceNowConstants.CONTENT_ENCODING);
 
-        if (model != null) {
-            message.getHeaders().putIfAbsent(ServiceNowConstants.MODEL, model.getName());
+        if (responseModel != null) {
+            message.getHeaders().putIfAbsent(ServiceNowConstants.MODEL, responseModel.getName());
+            message.getHeaders().putIfAbsent(ServiceNowConstants.RESPONSE_MODEL, responseModel.getName());
         }
 
         return this;
@@ -140,11 +143,33 @@ public abstract class AbstractServiceNowProcessor implements Processor {
     protected AbstractServiceNowProcessor setBody(Message message, Class<?> model, Response response) throws Exception {
         if (message != null && response != null) {
             if (ObjectHelper.isNotEmpty(response.getHeaderString(HttpHeaders.CONTENT_TYPE))) {
-                JsonNode node = response.readEntity(JsonNode.class);
-                Object body = unwrap(node, model);
+                JsonNode root = response.readEntity(JsonNode.class);
+                Map<String, String> responseAttributes = null;
+
+                if (root != null) {
+                    Iterator<Map.Entry<String, JsonNode>> fields = root.fields();
+                    while(fields.hasNext()) {
+                        final Map.Entry<String, JsonNode> entry = fields.next();
+                        final String key = entry.getKey();
+                        final JsonNode node = entry.getValue();
+
+                        if (ObjectHelper.equal("result", key, true)) {
+                            Object body = unwrap(node, model);
+                            if (body != null) {
+                                message.setBody(body);
+                            }
+                        } else {
+                            if (responseAttributes == null) {
+                                responseAttributes = new HashMap<>();
+                            }
+
+                            responseAttributes.put(key, node.textValue());
+                        }
+                    }
 
-                if (body != null) {
-                    message.setBody(body);
+                    if (responseAttributes != null) {
+                        message.setHeader(ServiceNowConstants.RESPONSE_META, responseAttributes);
+                    }
                 }
             }
         }
@@ -167,25 +192,20 @@ public abstract class AbstractServiceNowProcessor implements Processor {
         return this;
     }
 
-    protected Object unwrap(JsonNode answer, Class<?> model) throws IOException {
-        Object result = null;
-
-        if (answer != null) {
-            JsonNode node = answer.get("result");
-            if (node != null) {
-                if (node.isArray()) {
-                    if (model.isInstance(Map.class)) {
-                        // If the model is a Map, there's no need to use any
-                        // specific JavaType to instruct Jackson about the
-                        // expected element type
-                        result = mapper.treeToValue(node, List.class);
-                    } else {
-                        result = mapper.readValue(node.traverse(), javaTypeCache.get(model));
-                    }
-                } else {
-                    result = mapper.treeToValue(node, model);
-                }
+    protected Object unwrap(JsonNode node, Class<?> model) throws IOException {
+        Object result;
+
+        if (node.isArray()) {
+            if (model.isInstance(Map.class)) {
+                // If the model is a Map, there's no need to use any
+                // specific JavaType to instruct Jackson about the
+                // expected element type
+                result = mapper.treeToValue(node, List.class);
+            } else {
+                result = mapper.readValue(node.traverse(), javaTypeCache.get(model));
             }
+        } else {
+            result = mapper.treeToValue(node, model);
         }
 
         return result;
@@ -241,15 +261,34 @@ public abstract class AbstractServiceNowProcessor implements Processor {
         }
     }
 
-    protected Class<?> getModel(Message message) {
-        return getModel(message, null);
+    protected Class<?> getRequestModel(Message message) {
+        return getRequestModel(message, null);
     }
 
-    protected Class<?> getModel(Message message, String modelName) {
-        return message.getHeader(
-            ServiceNowConstants.MODEL,
-            ObjectHelper.isEmpty(modelName) ? Map.class : config.getModel(modelName, Map.class),
-            Class.class);
+    protected Class<?> getRequestModel(Message message, String modelName) {
+        Class<?> model = message.getHeader(ServiceNowConstants.REQUEST_MODEL, Class.class);
+        if (model == null) {
+            model = message.getHeader(ServiceNowConstants.MODEL, Class.class);
+        }
+
+        return model != null
+            ? model
+            : ObjectHelper.isEmpty(modelName) ? Map.class : config.getRequestModel(modelName, Map.class);
+    }
+
+    protected Class<?> getResponseModel(Message message) {
+        return getRequestModel(message, null);
+    }
+
+    protected Class<?> getResponseModel(Message message, String modelName) {
+        Class<?> model = message.getHeader(ServiceNowConstants.RESPONSE_MODEL, Class.class);
+        if (model == null) {
+            model = message.getHeader(ServiceNowConstants.MODEL, Class.class);
+        }
+
+        return model != null
+            ? model
+            : ObjectHelper.isEmpty(modelName) ? Map.class : config.getResponseModel(modelName, Map.class);
     }
 
     // *************************************************************************

http://git-wip-us.apache.org/repos/asf/camel/blob/0902c25e/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/ServiceNowComponent.java
----------------------------------------------------------------------
diff --git a/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/ServiceNowComponent.java b/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/ServiceNowComponent.java
index 74efddf..4690eee 100644
--- a/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/ServiceNowComponent.java
+++ b/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/ServiceNowComponent.java
@@ -29,21 +29,18 @@ import org.apache.camel.util.IntrospectionSupport;
  */
 public class ServiceNowComponent extends UriEndpointComponent {
 
-    private String userName;
-    private String password;
-    private String oauthClientId;
-    private String oauthClientSecret;
-    private String oauthTokenUrl;
-    private String apiUrl;
+    private ServiceNowConfiguration configuration;
 
     public ServiceNowComponent() {
         super(ServiceNowEndpoint.class);
+
+        this.configuration = new ServiceNowConfiguration();
     }
 
     @Override
     protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
         final CamelContext context = getCamelContext();
-        final ServiceNowConfiguration configuration = new ServiceNowConfiguration();
+        final ServiceNowConfiguration configuration = this.configuration.copy();
 
         Map<String, Object> models = IntrospectionSupport.extractProperties(parameters, "model.");
         for (Map.Entry<String, Object> entry : models.entrySet()) {
@@ -52,97 +49,107 @@ public class ServiceNowComponent extends UriEndpointComponent {
                 EndpointHelper.resolveParameter(context, (String)entry.getValue(), Class.class));
         }
 
-        setProperties(configuration, parameters);
-
-        if (configuration.getUserName() == null) {
-            configuration.setUserName(userName);
-        }
-        if (configuration.getPassword() == null) {
-            configuration.setPassword(password);
-        }
-        if (configuration.getOauthClientId() == null) {
-            configuration.setOauthClientId(oauthClientId);
+        Map<String, Object> requestModels = IntrospectionSupport.extractProperties(parameters, "requestModel.");
+        for (Map.Entry<String, Object> entry : requestModels.entrySet()) {
+            configuration.addRequestModel(
+                entry.getKey(),
+                EndpointHelper.resolveParameter(context, (String)entry.getValue(), Class.class));
         }
-        if (configuration.getOauthClientSecret() == null) {
-            configuration.setOauthClientSecret(oauthClientSecret);
+
+        Map<String, Object> responseModels = IntrospectionSupport.extractProperties(parameters, "responseModel.");
+        for (Map.Entry<String, Object> entry : requestModels.entrySet()) {
+            configuration.addResponseModel(
+                entry.getKey(),
+                EndpointHelper.resolveParameter(context, (String)entry.getValue(), Class.class));
         }
 
+        setProperties(configuration, parameters);
+
         String instanceName = getCamelContext().resolvePropertyPlaceholders(remaining);
         if (!configuration.hasApiUrl()) {
-            configuration.setApiUrl(apiUrl != null
-                ? apiUrl
-                : String.format("https://%s.service-now.com/api", instanceName)
-            );
+            configuration.setApiUrl(String.format("https://%s.service-now.com/api", instanceName));
         }
         if (!configuration.hasOautTokenUrl()) {
-            configuration.setOauthTokenUrl(oauthTokenUrl != null
-                ? oauthTokenUrl
-                : String.format("https://%s.service-now.com/oauth_token.do", instanceName)
-            );
+            configuration.setOauthTokenUrl(String.format("https://%s.service-now.com/oauth_token.do", instanceName));
         }
 
         return new ServiceNowEndpoint(uri, this, configuration, instanceName);
     }
 
+    public ServiceNowConfiguration getConfiguration() {
+        return configuration;
+    }
+
+    /**
+     * The ServiceNow default configuration
+     */
+    public void setConfiguration(ServiceNowConfiguration configuration) {
+        this.configuration = configuration;
+    }
+
     public String getApiUrl() {
-        return apiUrl;
+        return configuration.getApiUrl();
     }
 
     /**
      * The ServiceNow REST API url
      */
     public void setApiUrl(String apiUrl) {
-        this.apiUrl = apiUrl;
+        configuration.setApiUrl(apiUrl);
     }
 
     public String getUserName() {
-        return userName;
+        return configuration.getUserName();
     }
 
     /**
      * ServiceNow user account name
      */
     public void setUserName(String userName) {
-        this.userName = userName;
+        configuration.setUserName(userName);
     }
 
     public String getPassword() {
-        return password;
+        return configuration.getPassword();
     }
 
     /**
      * ServiceNow account password
      */
     public void setPassword(String password) {
-        this.password = password;
+        configuration.setPassword(password);
     }
 
     public String getOauthClientId() {
-        return oauthClientId;
+        return configuration.getOauthClientId();
     }
 
     /**
      * OAuth2 ClientID
      */
     public void setOauthClientId(String oauthClientId) {
-        this.oauthClientId = oauthClientId;
+        configuration.setOauthClientId(oauthClientId);
+    }
+
+    public String getOauthClientSecret() {
+        return configuration.getOauthClientSecret();
     }
 
     /**
      * OAuth2 ClientSecret
      */
     public void setOauthClientSecret(String oauthClientSecret) {
-        this.oauthClientSecret = oauthClientSecret;
+        configuration.setOauthClientSecret(oauthClientSecret);
     }
 
     public String getOauthTokenUrl() {
-        return oauthTokenUrl;
+        return configuration.getOauthTokenUrl();
     }
 
     /**
      * OAuth token Url
      */
     public void setOauthTokenUrl(String oauthTokenUrl) {
-        this.oauthTokenUrl = oauthTokenUrl;
+        configuration.setOauthTokenUrl(oauthTokenUrl);
     }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/0902c25e/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/ServiceNowConfiguration.java
----------------------------------------------------------------------
diff --git a/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/ServiceNowConfiguration.java b/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/ServiceNowConfiguration.java
index 9abfdfd..c82735b 100644
--- a/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/ServiceNowConfiguration.java
+++ b/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/ServiceNowConfiguration.java
@@ -22,13 +22,14 @@ import java.util.Map;
 import com.fasterxml.jackson.annotation.JsonInclude;
 import com.fasterxml.jackson.databind.DeserializationFeature;
 import com.fasterxml.jackson.databind.ObjectMapper;
+import org.apache.camel.RuntimeCamelException;
 import org.apache.camel.spi.Metadata;
 import org.apache.camel.spi.UriParam;
 import org.apache.camel.spi.UriParams;
 import org.apache.camel.util.ObjectHelper;
 
 @UriParams
-public class ServiceNowConfiguration {
+public class ServiceNowConfiguration implements Cloneable {
 
     private static final ObjectMapper MAPPER = new ObjectMapper()
         .configure(
@@ -90,8 +91,10 @@ public class ServiceNowConfiguration {
     private String displayValue = "false";
     @UriParam
     private Boolean inputDisplayValue = false;
-    @UriParam(prefix = "model.", multiValue = true, javaType = "java.lang.String")
-    private Map<String, Class<?>> models;
+    @UriParam(prefix = "request-model.", multiValue = true, javaType = "java.lang.String")
+    private Map<String, Class<?>> requestModels;
+    @UriParam(prefix = "response-model.", multiValue = true, javaType = "java.lang.String")
+    private Map<String, Class<?>> responseModels;
     @UriParam(label = "advanced")
     private ObjectMapper mapper = MAPPER;
     @UriParam(defaultValue = "HELSINKI", enums = "FUJI,GENEVA,HELSINKI")
@@ -414,37 +417,8 @@ public class ServiceNowConfiguration {
         this.inputDisplayValue = inputDisplayValue;
     }
 
-    public Map<String, Class<?>> getModels() {
-        return models;
-    }
-
-    /**
-     * Defines the default model to use for a table
-     */
-    public void setModels(Map<String, Class<?>> models) {
-        this.models = models;
-    }
-
-    public void addModel(String name, Class<?> type) {
-        if (this.models == null) {
-            this.models = new HashMap<>();
-        }
-
-        this.models.put(name, type);
-    }
-
-    public Class<?> getModel(String name) {
-        return getModel(name, null);
-    }
-
-    public Class<?> getModel(String name, Class<?> defaultType) {
-        Class<?> model = defaultType;
-
-        if (this.models != null && this.models.containsKey(name)) {
-            model = this.models.get(name);
-        }
-
-        return model;
+    public Map<String, Class<?>> getRequestModels() {
+        return requestModels;
     }
 
     /**
@@ -485,4 +459,106 @@ public class ServiceNowConfiguration {
     public void setTopLevelOnly(Boolean topLevelOnly) {
         this.topLevelOnly = topLevelOnly;
     }
+
+    // *************************************************
+    //
+    // *************************************************
+
+    public void setModels(Map<String, Class<?>> models) {
+        setRequestModels(models);
+        setResponseModels(models);
+    }
+
+    public void addModel(String name, Class<?> type) {
+        addRequestModel(name, type);
+        addResponseModel(name, type);
+    }
+
+    // *************************************************
+    // Request model
+    // *************************************************
+
+    /**
+     * Defines the request model
+     */
+    public void setRequestModels(Map<String, Class<?>> models) {
+        if (this.requestModels == null) {
+            this.requestModels = new HashMap<>();
+        }
+
+        this.requestModels.clear();
+        this.requestModels.putAll(models);
+    }
+
+    public void addRequestModel(String name, Class<?> type) {
+        if (this.requestModels == null) {
+            this.requestModels = new HashMap<>();
+        }
+
+        this.requestModels.put(name, type);
+    }
+
+    public Class<?> getRequestModel(String name) {
+        return getRequestModel(name, null);
+    }
+
+    public Class<?> getRequestModel(String name, Class<?> defaultType) {
+        Class<?> model = defaultType;
+
+        if (this.requestModels != null && this.requestModels.containsKey(name)) {
+            model = this.requestModels.get(name);
+        }
+
+        return model;
+    }
+
+    // *************************************************
+    // Response model
+    // *************************************************
+
+    /**
+     * Defines the response model
+     */
+    public void setResponseModels(Map<String, Class<?>> models) {
+        if (this.responseModels == null) {
+            this.responseModels = new HashMap<>();
+        }
+
+        this.responseModels.putAll(models);
+    }
+
+    public void addResponseModel(String name, Class<?> type) {
+        if (this.responseModels == null) {
+            this.responseModels = new HashMap<>();
+        }
+
+        this.responseModels.clear();
+        this.responseModels.put(name, type);
+    }
+
+    public Class<?> getResponseModel(String name) {
+        return getResponseModel(name, null);
+    }
+
+    public Class<?> getResponseModel(String name, Class<?> defaultType) {
+        Class<?> model = defaultType;
+
+        if (this.responseModels != null && this.responseModels.containsKey(name)) {
+            model = this.responseModels.get(name);
+        }
+
+        return model;
+    }
+
+    // *************************************************
+    //
+    // *************************************************
+
+    public ServiceNowConfiguration copy() {
+        try {
+            return (ServiceNowConfiguration)super.clone();
+        } catch (CloneNotSupportedException e) {
+            throw new RuntimeCamelException(e);
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/0902c25e/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/ServiceNowConstants.java
----------------------------------------------------------------------
diff --git a/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/ServiceNowConstants.java b/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/ServiceNowConstants.java
index e699dd7..b5f2b3a 100644
--- a/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/ServiceNowConstants.java
+++ b/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/ServiceNowConstants.java
@@ -23,6 +23,8 @@ public final class ServiceNowConstants {
     public static final String ACTION = "CamelServiceNowAction";
     public static final String ACTION_SUBJECT = "CamelServiceNowActionSubject";
     public static final String MODEL = "CamelServiceNowModel";
+    public static final String REQUEST_MODEL = "CamelServiceNowRequestModel";
+    public static final String RESPONSE_MODEL = "CamelServiceNowResponseModel";
     public static final String OFFSET_NEXT = "CamelServiceNowOffsetNext";
     public static final String OFFSET_PREV = "CamelServiceNowOffsetPrev";
     public static final String OFFSET_FIRST = "CamelServiceNowOffsetFirst";
@@ -30,6 +32,7 @@ public final class ServiceNowConstants {
     public static final String CONTENT_TYPE = "CamelServiceNowContentType";
     public static final String CONTENT_ENCODING = "CamelServiceNowContentEncoding";
     public static final String CONTENT_META = "CamelServiceNowContentMeta";
+    public static final String RESPONSE_META = "CamelServiceNowResponseMeta";
 
     public static final String ATTACHMENT_META_HEADER = "X-Attachment-Metadata";
 

http://git-wip-us.apache.org/repos/asf/camel/blob/0902c25e/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/releases/fuji/FujiServiceNowAggregateProcessor.java
----------------------------------------------------------------------
diff --git a/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/releases/fuji/FujiServiceNowAggregateProcessor.java b/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/releases/fuji/FujiServiceNowAggregateProcessor.java
index 925b16e..52966a4 100644
--- a/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/releases/fuji/FujiServiceNowAggregateProcessor.java
+++ b/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/releases/fuji/FujiServiceNowAggregateProcessor.java
@@ -35,7 +35,7 @@ class FujiServiceNowAggregateProcessor extends FujiServiceNowProcessor {
     }
 
     @Override
-    protected void doProcess(Exchange exchange, Class<?> model, String action, String tableName, String sysId) throws Exception {
+    protected void doProcess(Exchange exchange, Class<?> requestModel, Class<?> responseModel, String action, String tableName, String sysId) throws Exception {
         Response response;
         if (ObjectHelper.equal(ServiceNowConstants.ACTION_RETRIEVE, action, true)) {
             response = retrieveStats(exchange.getIn(), tableName);
@@ -43,7 +43,7 @@ class FujiServiceNowAggregateProcessor extends FujiServiceNowProcessor {
             throw new IllegalArgumentException("Unknown action " + action);
         }
 
-        setBodyAndHeaders(exchange.getIn(), model, response);
+        setBodyAndHeaders(exchange.getIn(), responseModel, response);
     }
 
     private Response retrieveStats(Message in, String tableName) throws Exception {

http://git-wip-us.apache.org/repos/asf/camel/blob/0902c25e/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/releases/fuji/FujiServiceNowImportSetProcessor.java
----------------------------------------------------------------------
diff --git a/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/releases/fuji/FujiServiceNowImportSetProcessor.java b/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/releases/fuji/FujiServiceNowImportSetProcessor.java
index e118bd0..36fad6e 100644
--- a/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/releases/fuji/FujiServiceNowImportSetProcessor.java
+++ b/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/releases/fuji/FujiServiceNowImportSetProcessor.java
@@ -34,17 +34,17 @@ class FujiServiceNowImportSetProcessor extends FujiServiceNowProcessor {
     }
 
     @Override
-    protected void doProcess(Exchange exchange, Class<?> model, String action, String tableName, String sysId) throws Exception {
+    protected void doProcess(Exchange exchange, Class<?> requestModel, Class<?> responseModel, String action, String tableName, String sysId) throws Exception {
         Response response;
         if (ObjectHelper.equal(ServiceNowConstants.ACTION_RETRIEVE, action, true)) {
             response = retrieveRecord(exchange.getIn(), tableName, sysId);
         } else if (ObjectHelper.equal(ServiceNowConstants.ACTION_CREATE, action, true)) {
-            response = createRecord(exchange.getIn(), model, tableName);
+            response = createRecord(exchange.getIn(), requestModel, responseModel, tableName);
         } else {
             throw new IllegalArgumentException("Unknown action " + action);
         }
 
-        setBodyAndHeaders(exchange.getIn(), model, response);
+        setBodyAndHeaders(exchange.getIn(), responseModel, response);
     }
 
     /*
@@ -65,8 +65,8 @@ class FujiServiceNowImportSetProcessor extends FujiServiceNowProcessor {
      * POST
      * https://instance.service-now.com/api/now/import/{tableName}
      */
-    private Response createRecord(Message in, Class<?> model, String tableName) throws Exception {
-        validateBody(in, model);
+    private Response createRecord(Message in, Class<?> requestModel, Class<?> responseModell, String tableName) throws Exception {
+        validateBody(in, requestModel);
         return client.reset()
             .types(MediaType.APPLICATION_JSON_TYPE)
             .path("now")

http://git-wip-us.apache.org/repos/asf/camel/blob/0902c25e/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/releases/fuji/FujiServiceNowProcessor.java
----------------------------------------------------------------------
diff --git a/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/releases/fuji/FujiServiceNowProcessor.java b/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/releases/fuji/FujiServiceNowProcessor.java
index bfde592..17d0960 100644
--- a/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/releases/fuji/FujiServiceNowProcessor.java
+++ b/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/releases/fuji/FujiServiceNowProcessor.java
@@ -34,22 +34,23 @@ public abstract class FujiServiceNowProcessor extends AbstractServiceNowProcesso
     public void process(Exchange exchange) throws Exception {
         final Message in = exchange.getIn();
         final String tableName = in.getHeader(ServiceNowParams.PARAM_TABLE_NAME.getHeader(), config.getTable(), String.class);
-        final Class<?> model = getModel(in, tableName);
+        final Class<?> requestModel = getRequestModel(in, tableName);
+        final Class<?> responseModel = getResponseModel(in, tableName);
         final String action = in.getHeader(ServiceNowConstants.ACTION, String.class);
         final String sysId = in.getHeader(ServiceNowParams.PARAM_SYS_ID.getHeader(), String.class);
 
         doProcess(
             exchange,
-            ObjectHelper.notNull(model, "model"),
+            ObjectHelper.notNull(requestModel, "requestModel"),
+            ObjectHelper.notNull(responseModel, "responseModel"),
             ObjectHelper.notNull(action, "action"),
-            ObjectHelper.notNull(tableName, "tableName"),
-            sysId);
+            ObjectHelper.notNull(tableName, "tableName"), sysId);
     }
 
     protected abstract void doProcess(
         Exchange exchange,
-        Class<?> model,
-        String action,
+        Class<?> requestModel,
+        Class<?> responseModel, String action,
         String tableName,
         String sysId) throws Exception;
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/0902c25e/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/releases/fuji/FujiServiceNowTableProcessor.java
----------------------------------------------------------------------
diff --git a/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/releases/fuji/FujiServiceNowTableProcessor.java b/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/releases/fuji/FujiServiceNowTableProcessor.java
index 4cd25be..c6f305e 100644
--- a/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/releases/fuji/FujiServiceNowTableProcessor.java
+++ b/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/releases/fuji/FujiServiceNowTableProcessor.java
@@ -34,23 +34,23 @@ class FujiServiceNowTableProcessor extends FujiServiceNowProcessor {
     }
 
     @Override
-    protected void doProcess(Exchange exchange, Class<?> model, String action, String tableName, String sysId) throws Exception {
+    protected void doProcess(Exchange exchange, Class<?> requestModel, Class<?> responseModel, String action, String tableName, String sysId) throws Exception {
         Response response;
         if (ObjectHelper.equal(ServiceNowConstants.ACTION_RETRIEVE, action, true)) {
-            response = retrieveRecord(exchange.getIn(), model, tableName, sysId);
+            response = retrieveRecord(exchange.getIn(), requestModel, responseModel, tableName, sysId);
         } else if (ObjectHelper.equal(ServiceNowConstants.ACTION_CREATE, action, true)) {
-            response = createRecord(exchange.getIn(), model, tableName);
+            response = createRecord(exchange.getIn(), requestModel, responseModel, tableName);
         } else if (ObjectHelper.equal(ServiceNowConstants.ACTION_MODIFY, action, true)) {
-            response = modifyRecord(exchange.getIn(), model, tableName, sysId);
+            response = modifyRecord(exchange.getIn(), requestModel, responseModel, tableName, sysId);
         } else if (ObjectHelper.equal(ServiceNowConstants.ACTION_DELETE, action, true)) {
-            response = deleteRecord(exchange.getIn(), model, tableName, sysId);
+            response = deleteRecord(exchange.getIn(), requestModel, responseModel, tableName, sysId);
         } else if (ObjectHelper.equal(ServiceNowConstants.ACTION_UPDATE, action, true)) {
-            response = updateRecord(exchange.getIn(), model, tableName, sysId);
+            response = updateRecord(exchange.getIn(), requestModel, responseModel, tableName, sysId);
         } else {
             throw new IllegalArgumentException("Unknown action " + action);
         }
 
-        setBodyAndHeaders(exchange.getIn(), model, response);
+        setBodyAndHeaders(exchange.getIn(), responseModel, response);
     }
 
     /*
@@ -58,7 +58,7 @@ class FujiServiceNowTableProcessor extends FujiServiceNowProcessor {
      * https://instance.service-now.com/api/now/table/{tableName}
      * https://instance.service-now.com/api/now/table/{tableName}/{sys_id}
      */
-    private Response retrieveRecord(Message in, Class<?> model, String tableName, String sysId) throws Exception {
+    private Response retrieveRecord(Message in, Class<?> requestModel, Class<?> responseModel, String tableName, String sysId) throws Exception {
         return ObjectHelper.isEmpty(sysId)
             ? client.reset()
                 .types(MediaType.APPLICATION_JSON_TYPE)
@@ -89,8 +89,8 @@ class FujiServiceNowTableProcessor extends FujiServiceNowProcessor {
      * POST
      * https://instance.service-now.com/api/now/table/{tableName}
      */
-    private Response createRecord(Message in, Class<?> model, String tableName) throws Exception {
-        validateBody(in, model);
+    private Response createRecord(Message in, Class<?> requestModel, Class<?> responseModel, String tableName) throws Exception {
+        validateBody(in, requestModel);
         return client.reset()
             .types(MediaType.APPLICATION_JSON_TYPE)
             .path("now")
@@ -109,8 +109,8 @@ class FujiServiceNowTableProcessor extends FujiServiceNowProcessor {
      * PUT
      * https://instance.service-now.com/api/now/table/{tableName}/{sys_id}
      */
-    private Response modifyRecord(Message in, Class<?> model, String tableName, String sysId) throws Exception {
-        validateBody(in, model);
+    private Response modifyRecord(Message in, Class<?> requestModel, Class<?> responseModel, String tableName, String sysId) throws Exception {
+        validateBody(in, requestModel);
         return client.reset()
             .types(MediaType.APPLICATION_JSON_TYPE)
             .path("now")
@@ -130,7 +130,7 @@ class FujiServiceNowTableProcessor extends FujiServiceNowProcessor {
      * DELETE
      * https://instance.service-now.com/api/now/table/{tableName}/{sys_id}
      */
-    private Response deleteRecord(Message in, Class<?> model, String tableName, String sysId) throws Exception {
+    private Response deleteRecord(Message in, Class<?> requestModel, Class<?> responseModel, String tableName, String sysId) throws Exception {
         return client.reset()
             .types(MediaType.APPLICATION_JSON_TYPE)
             .path("now")
@@ -144,8 +144,8 @@ class FujiServiceNowTableProcessor extends FujiServiceNowProcessor {
      * PATCH
      * http://instance.service-now.com/api/now/table/{tableName}/{sys_id}
      */
-    private Response updateRecord(Message in, Class<?> model, String tableName, String sysId) throws Exception {
-        validateBody(in, model);
+    private Response updateRecord(Message in, Class<?> requestModel, Class<?> responseModel, String tableName, String sysId) throws Exception {
+        validateBody(in, requestModel);
         return client.reset()
             .types(MediaType.APPLICATION_JSON_TYPE)
             .path("now")

http://git-wip-us.apache.org/repos/asf/camel/blob/0902c25e/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/releases/helsinki/HelsinkiServiceNowAggregateProcessor.java
----------------------------------------------------------------------
diff --git a/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/releases/helsinki/HelsinkiServiceNowAggregateProcessor.java b/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/releases/helsinki/HelsinkiServiceNowAggregateProcessor.java
index 17dbfdb..924d1d8 100644
--- a/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/releases/helsinki/HelsinkiServiceNowAggregateProcessor.java
+++ b/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/releases/helsinki/HelsinkiServiceNowAggregateProcessor.java
@@ -49,7 +49,7 @@ class HelsinkiServiceNowAggregateProcessor extends AbstractServiceNowProcessor {
     private void retrieveStats(Exchange exchange) throws Exception {
         final Message in = exchange.getIn();
         final String tableName = in.getHeader(ServiceNowParams.PARAM_TABLE_NAME.getHeader(), config.getTable(), String.class);
-        final Class<?> model = getModel(in, tableName);
+        final Class<?> responseModel = getResponseModel(in, tableName);
 
         Response response = client.reset()
             .types(MediaType.APPLICATION_JSON_TYPE)
@@ -69,6 +69,6 @@ class HelsinkiServiceNowAggregateProcessor extends AbstractServiceNowProcessor {
             .query(ServiceNowParams.SYSPARM_DISPLAY_VALUE, in)
             .invoke(HttpMethod.GET);
 
-        setBodyAndHeaders(in, model, response);
+        setBodyAndHeaders(in, responseModel, response);
     }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/0902c25e/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/releases/helsinki/HelsinkiServiceNowAttachmentProcessor.java
----------------------------------------------------------------------
diff --git a/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/releases/helsinki/HelsinkiServiceNowAttachmentProcessor.java b/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/releases/helsinki/HelsinkiServiceNowAttachmentProcessor.java
index 097c220..1f70777 100644
--- a/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/releases/helsinki/HelsinkiServiceNowAttachmentProcessor.java
+++ b/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/releases/helsinki/HelsinkiServiceNowAttachmentProcessor.java
@@ -59,7 +59,7 @@ public class HelsinkiServiceNowAttachmentProcessor extends AbstractServiceNowPro
     private void retrieveMeta(Exchange exchange) throws Exception {
         final Message in = exchange.getIn();
         final String tableName = in.getHeader(ServiceNowParams.PARAM_TABLE_NAME.getHeader(), config.getTable(), String.class);
-        final Class<?> model = getModel(in, tableName);
+        final Class<?> responseModel = getResponseModel(in, tableName);
         final String sysId = in.getHeader(ServiceNowParams.PARAM_SYS_ID.getHeader(), String.class);
 
         Response response = ObjectHelper.isEmpty(sysId)
@@ -78,7 +78,7 @@ public class HelsinkiServiceNowAttachmentProcessor extends AbstractServiceNowPro
                 .path(ObjectHelper.notNull(sysId, "sysId"))
                 .invoke(HttpMethod.GET);
 
-        setBodyAndHeaders(in, model, response);
+        setBodyAndHeaders(in, responseModel, response);
     }
 
     /*
@@ -92,7 +92,6 @@ public class HelsinkiServiceNowAttachmentProcessor extends AbstractServiceNowPro
      */
     private void retrieveContent(Exchange exchange) throws Exception {
         final Message in = exchange.getIn();
-        final String tableName = in.getHeader(ServiceNowParams.PARAM_TABLE_NAME.getHeader(), config.getTable(), String.class);
         final String sysId = in.getHeader(ServiceNowParams.PARAM_SYS_ID.getHeader(), String.class);
 
         Response response = client.reset()
@@ -122,7 +121,7 @@ public class HelsinkiServiceNowAttachmentProcessor extends AbstractServiceNowPro
     private void uploadContent(Exchange exchange) throws Exception {
         final Message in = exchange.getIn();
         final String tableName = in.getHeader(ServiceNowParams.PARAM_TABLE_NAME.getHeader(), config.getTable(), String.class);
-        final Class<?> model = getModel(in, tableName);
+        final Class<?> responseModel = getResponseModel(in, tableName);
 
         Response response = client.reset()
             .type(ObjectHelper.notNull(
@@ -138,7 +137,7 @@ public class HelsinkiServiceNowAttachmentProcessor extends AbstractServiceNowPro
             .query(ServiceNowParams.PARAM_ENCRYPTION_CONTEXT, in)
             .invoke(HttpMethod.POST, in.getMandatoryBody(InputStream.class));
 
-        setBodyAndHeaders(in, model, response);
+        setBodyAndHeaders(in, responseModel, response);
     }
 
     /*
@@ -153,7 +152,7 @@ public class HelsinkiServiceNowAttachmentProcessor extends AbstractServiceNowPro
     private void deleteContent(Exchange exchange) throws Exception {
         final Message in = exchange.getIn();
         final String tableName = in.getHeader(ServiceNowParams.PARAM_TABLE_NAME.getHeader(), config.getTable(), String.class);
-        final Class<?> model = getModel(in, tableName);
+        final Class<?> responseModel = getResponseModel(in, tableName);
         final String sysId = in.getHeader(ServiceNowParams.PARAM_SYS_ID.getHeader(), String.class);
 
         Response response = client.reset()
@@ -163,6 +162,6 @@ public class HelsinkiServiceNowAttachmentProcessor extends AbstractServiceNowPro
             .path(ObjectHelper.notNull(sysId, "sysId"))
             .invoke(HttpMethod.DELETE);
 
-        setBodyAndHeaders(in, model, response);
+        setBodyAndHeaders(in, responseModel, response);
     }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/0902c25e/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/releases/helsinki/HelsinkiServiceNowImportSetProcessor.java
----------------------------------------------------------------------
diff --git a/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/releases/helsinki/HelsinkiServiceNowImportSetProcessor.java b/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/releases/helsinki/HelsinkiServiceNowImportSetProcessor.java
index db35b9e..8cde09d 100644
--- a/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/releases/helsinki/HelsinkiServiceNowImportSetProcessor.java
+++ b/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/releases/helsinki/HelsinkiServiceNowImportSetProcessor.java
@@ -46,7 +46,7 @@ class HelsinkiServiceNowImportSetProcessor extends AbstractServiceNowProcessor {
     private void retrieveRecord(Exchange exchange) throws Exception {
         final Message in = exchange.getIn();
         final String tableName = in.getHeader(ServiceNowParams.PARAM_TABLE_NAME.getHeader(), config.getTable(), String.class);
-        final Class<?> model = getModel(in, tableName);
+        final Class<?> responseModel = getResponseModel(in, tableName);
         final String sysId = in.getHeader(ServiceNowParams.PARAM_SYS_ID.getHeader(), String.class);
 
         Response response = client.reset()
@@ -57,7 +57,7 @@ class HelsinkiServiceNowImportSetProcessor extends AbstractServiceNowProcessor {
             .path(ObjectHelper.notNull(sysId, "sysId"))
             .invoke(HttpMethod.GET);
 
-        setBodyAndHeaders(in, model, response);
+        setBodyAndHeaders(in, responseModel, response);
     }
 
     /*
@@ -67,9 +67,10 @@ class HelsinkiServiceNowImportSetProcessor extends AbstractServiceNowProcessor {
     private void createRecord(Exchange exchange) throws Exception {
         final Message in = exchange.getIn();
         final String tableName = in.getHeader(ServiceNowParams.PARAM_TABLE_NAME.getHeader(), config.getTable(), String.class);
-        final Class<?> model = getModel(in, tableName);
+        final Class<?> requestModel = getRequestModel(in, tableName);
+        final Class<?> responseModel = getResponseModel(in, tableName);
 
-        validateBody(in, model);
+        validateBody(in, requestModel);
         Response response = client.reset()
             .types(MediaType.APPLICATION_JSON_TYPE)
             .path("now")
@@ -77,6 +78,6 @@ class HelsinkiServiceNowImportSetProcessor extends AbstractServiceNowProcessor {
             .path(tableName)
             .invoke(HttpMethod.POST, in.getMandatoryBody());
 
-        setBodyAndHeaders(in, model, response);
+        setBodyAndHeaders(in, responseModel, response);
     }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/0902c25e/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/releases/helsinki/HelsinkiServiceNowMiscProcessor.java
----------------------------------------------------------------------
diff --git a/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/releases/helsinki/HelsinkiServiceNowMiscProcessor.java b/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/releases/helsinki/HelsinkiServiceNowMiscProcessor.java
index 0511e03..f3b9585 100644
--- a/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/releases/helsinki/HelsinkiServiceNowMiscProcessor.java
+++ b/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/releases/helsinki/HelsinkiServiceNowMiscProcessor.java
@@ -52,7 +52,7 @@ class HelsinkiServiceNowMiscProcessor extends AbstractServiceNowProcessor {
      */
     private void retrieveUserRoleInheritance(Exchange exchange) throws Exception {
         final Message in = exchange.getIn();
-        final Class<?> model = getModel(in);
+        final Class<?> responseModel = getResponseModel(in);
 
         Response response = client.reset()
             .types(MediaType.APPLICATION_JSON_TYPE)
@@ -61,7 +61,7 @@ class HelsinkiServiceNowMiscProcessor extends AbstractServiceNowProcessor {
             .query(ServiceNowParams.PARAM_USER_SYS_ID, in)
             .invoke(HttpMethod.GET);
 
-        setBodyAndHeaders(in, model, response);
+        setBodyAndHeaders(in, responseModel, response);
     }
 
     /*
@@ -75,7 +75,7 @@ class HelsinkiServiceNowMiscProcessor extends AbstractServiceNowProcessor {
      */
     private void uploadIdentifyReconcile(Exchange exchange) throws Exception {
         final Message in = exchange.getIn();
-        final Class<?> model = getModel(in);
+        final Class<?> responseModel = getResponseModel(in);
 
         Response response = client.reset()
             .types(MediaType.APPLICATION_JSON_TYPE)
@@ -84,6 +84,6 @@ class HelsinkiServiceNowMiscProcessor extends AbstractServiceNowProcessor {
             .query(ServiceNowParams.SYSPARM_DATA_SOURCE, in)
             .invoke(HttpMethod.POST, in.getMandatoryBody());
 
-        setBodyAndHeaders(in, model, response);
+        setBodyAndHeaders(in, responseModel, response);
     }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/0902c25e/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/releases/helsinki/HelsinkiServiceNowScorecardProcessor.java
----------------------------------------------------------------------
diff --git a/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/releases/helsinki/HelsinkiServiceNowScorecardProcessor.java b/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/releases/helsinki/HelsinkiServiceNowScorecardProcessor.java
index 78afa77..5b959dd 100644
--- a/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/releases/helsinki/HelsinkiServiceNowScorecardProcessor.java
+++ b/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/releases/helsinki/HelsinkiServiceNowScorecardProcessor.java
@@ -49,7 +49,7 @@ class HelsinkiServiceNowScorecardProcessor extends AbstractServiceNowProcessor {
      */
     private void retrievePerformanceAnalytics(Exchange exchange) throws Exception {
         final Message in = exchange.getIn();
-        final Class<?> model = getModel(in);
+        final Class<?> responseModel = getResponseModel(in);
 
         Response response = client.reset()
             .types(MediaType.APPLICATION_JSON_TYPE)
@@ -79,6 +79,6 @@ class HelsinkiServiceNowScorecardProcessor extends AbstractServiceNowProcessor {
             .query(ServiceNowParams.SYSPARM_INCLUDE_SCORE_NOTES, in)
             .invoke(HttpMethod.GET);
 
-        setBodyAndHeaders(in, model, response);
+        setBodyAndHeaders(in, responseModel, response);
     }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/0902c25e/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/releases/helsinki/HelsinkiServiceNowServiceCatalogCartsProcessor.java
----------------------------------------------------------------------
diff --git a/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/releases/helsinki/HelsinkiServiceNowServiceCatalogCartsProcessor.java b/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/releases/helsinki/HelsinkiServiceNowServiceCatalogCartsProcessor.java
index 058dc5e..9b6ab6e 100644
--- a/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/releases/helsinki/HelsinkiServiceNowServiceCatalogCartsProcessor.java
+++ b/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/releases/helsinki/HelsinkiServiceNowServiceCatalogCartsProcessor.java
@@ -58,7 +58,7 @@ class HelsinkiServiceNowServiceCatalogCartsProcessor extends AbstractServiceNowP
      */
     private void retrieveCarts(Exchange exchange) throws Exception {
         final Message in = exchange.getIn();
-        final Class<?> model = getModel(in);
+        final Class<?> responseModel = getResponseModel(in);
 
         Response response = client.reset()
             .types(MediaType.APPLICATION_JSON_TYPE)
@@ -67,7 +67,7 @@ class HelsinkiServiceNowServiceCatalogCartsProcessor extends AbstractServiceNowP
             .path("cart")
             .invoke(HttpMethod.GET);
 
-        setBodyAndHeaders(in, model, response);
+        setBodyAndHeaders(in, responseModel, response);
     }
 
     /*
@@ -81,7 +81,7 @@ class HelsinkiServiceNowServiceCatalogCartsProcessor extends AbstractServiceNowP
      */
     private void retrieveDeliveryAddress(Exchange exchange) throws Exception {
         final Message in = exchange.getIn();
-        final Class<?> model = getModel(in);
+        final Class<?> responseModel = getResponseModel(in);
 
         Response response = client.reset()
             .types(MediaType.APPLICATION_JSON_TYPE)
@@ -92,7 +92,7 @@ class HelsinkiServiceNowServiceCatalogCartsProcessor extends AbstractServiceNowP
             .path(getMandatoryRequestParamFromHeader(ServiceNowParams.PARAM_USER_ID, in))
             .invoke(HttpMethod.GET);
 
-        setBodyAndHeaders(in, model, response);
+        setBodyAndHeaders(in, responseModel, response);
     }
 
     /*
@@ -106,7 +106,7 @@ class HelsinkiServiceNowServiceCatalogCartsProcessor extends AbstractServiceNowP
      */
     private void updateCart(Exchange exchange) throws Exception {
         final Message in = exchange.getIn();
-        final Class<?> model = getModel(in);
+        final Class<?> responseModel = getResponseModel(in);
 
         Response response = client.reset()
             .types(MediaType.APPLICATION_JSON_TYPE)
@@ -116,7 +116,7 @@ class HelsinkiServiceNowServiceCatalogCartsProcessor extends AbstractServiceNowP
             .path(getMandatoryRequestParamFromHeader(ServiceNowParams.PARAM_CART_ITEM_ID, in))
             .invoke(HttpMethod.POST, in.getMandatoryBody());
 
-        setBodyAndHeaders(in, model, response);
+        setBodyAndHeaders(in, responseModel, response);
     }
 
     /*
@@ -131,7 +131,7 @@ class HelsinkiServiceNowServiceCatalogCartsProcessor extends AbstractServiceNowP
      */
     private void deleteCart(Exchange exchange) throws Exception {
         final Message in = exchange.getIn();
-        final Class<?> model = getModel(in);
+        final Class<?> responseModel = getResponseModel(in);
 
         Response response = client.reset()
             .types(MediaType.APPLICATION_JSON_TYPE)
@@ -142,7 +142,7 @@ class HelsinkiServiceNowServiceCatalogCartsProcessor extends AbstractServiceNowP
             .path("empty")
             .invoke(HttpMethod.DELETE);
 
-        setBodyAndHeaders(in, model, response);
+        setBodyAndHeaders(in, responseModel, response);
     }
 
     /*
@@ -160,7 +160,7 @@ class HelsinkiServiceNowServiceCatalogCartsProcessor extends AbstractServiceNowP
      */
     private void retrieveCheckoutCart(Exchange exchange) throws Exception {
         final Message in = exchange.getIn();
-        final Class<?> model = getModel(in);
+        final Class<?> responseModel = getResponseModel(in);
 
         Response response = client.reset()
             .types(MediaType.APPLICATION_JSON_TYPE)
@@ -170,7 +170,7 @@ class HelsinkiServiceNowServiceCatalogCartsProcessor extends AbstractServiceNowP
             .path("checkout")
             .invoke(HttpMethod.POST);
 
-        setBodyAndHeaders(in, model, response);
+        setBodyAndHeaders(in, responseModel, response);
     }
 
     /*
@@ -185,7 +185,7 @@ class HelsinkiServiceNowServiceCatalogCartsProcessor extends AbstractServiceNowP
      */
     private void checkoutCart(Exchange exchange) throws Exception {
         final Message in = exchange.getIn();
-        final Class<?> model = getModel(in);
+        final Class<?> responseModel = getResponseModel(in);
 
         Response response = client.reset()
             .types(MediaType.APPLICATION_JSON_TYPE)
@@ -195,6 +195,6 @@ class HelsinkiServiceNowServiceCatalogCartsProcessor extends AbstractServiceNowP
             .path("submit_order")
             .invoke(HttpMethod.POST);
 
-        setBodyAndHeaders(in, model, response);
+        setBodyAndHeaders(in, responseModel, response);
     }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/0902c25e/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/releases/helsinki/HelsinkiServiceNowServiceCatalogCategoriesProcessor.java
----------------------------------------------------------------------
diff --git a/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/releases/helsinki/HelsinkiServiceNowServiceCatalogCategoriesProcessor.java b/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/releases/helsinki/HelsinkiServiceNowServiceCatalogCategoriesProcessor.java
index aa361dc..d3037f2 100644
--- a/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/releases/helsinki/HelsinkiServiceNowServiceCatalogCategoriesProcessor.java
+++ b/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/releases/helsinki/HelsinkiServiceNowServiceCatalogCategoriesProcessor.java
@@ -49,7 +49,7 @@ class HelsinkiServiceNowServiceCatalogCategoriesProcessor extends AbstractServic
      */
     private void retrieveCategory(Exchange exchange) throws Exception {
         final Message in = exchange.getIn();
-        final Class<?> model = getModel(in);
+        final Class<?> responseModel = getResponseModel(in);
         final String sysId = in.getHeader(ServiceNowParams.PARAM_SYS_ID.getHeader(), String.class);
 
         Response response = client.reset()
@@ -61,6 +61,6 @@ class HelsinkiServiceNowServiceCatalogCategoriesProcessor extends AbstractServic
             .query(ServiceNowParams.SYSPARM_VIEW, in)
             .invoke(HttpMethod.GET);
 
-        setBodyAndHeaders(in, model, response);
+        setBodyAndHeaders(in, responseModel, response);
     }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/0902c25e/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/releases/helsinki/HelsinkiServiceNowServiceCatalogItemsProcessor.java
----------------------------------------------------------------------
diff --git a/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/releases/helsinki/HelsinkiServiceNowServiceCatalogItemsProcessor.java b/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/releases/helsinki/HelsinkiServiceNowServiceCatalogItemsProcessor.java
index 106f38d..9204e6c 100644
--- a/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/releases/helsinki/HelsinkiServiceNowServiceCatalogItemsProcessor.java
+++ b/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/releases/helsinki/HelsinkiServiceNowServiceCatalogItemsProcessor.java
@@ -60,7 +60,7 @@ class HelsinkiServiceNowServiceCatalogItemsProcessor extends AbstractServiceNowP
      */
     private void retrieveItems(Exchange exchange) throws Exception {
         final Message in = exchange.getIn();
-        final Class<?> model = getModel(in);
+        final Class<?> responseModel = getResponseModel(in);
         final String sysId = in.getHeader(ServiceNowParams.PARAM_SYS_ID.getHeader(), String.class);
 
         Response response = ObjectHelper.isEmpty(sysId)
@@ -86,7 +86,7 @@ class HelsinkiServiceNowServiceCatalogItemsProcessor extends AbstractServiceNowP
                 .query(ServiceNowParams.SYSPARM_VIEW, in)
                 .invoke(HttpMethod.GET);
 
-        setBodyAndHeaders(in, model, response);
+        setBodyAndHeaders(in, responseModel, response);
     }
 
     /*
@@ -101,7 +101,7 @@ class HelsinkiServiceNowServiceCatalogItemsProcessor extends AbstractServiceNowP
      */
     private void submitItemGuide(Exchange exchange) throws Exception {
         final Message in = exchange.getIn();
-        final Class<?> model = getModel(in);
+        final Class<?> responseModel = getResponseModel(in);
         final String sysId = in.getHeader(ServiceNowParams.PARAM_SYS_ID.getHeader(), String.class);
 
         Response response =  client.reset()
@@ -114,7 +114,7 @@ class HelsinkiServiceNowServiceCatalogItemsProcessor extends AbstractServiceNowP
             .query(ServiceNowParams.SYSPARM_VIEW, in)
             .invoke(HttpMethod.POST, in.getMandatoryBody());
 
-        setBodyAndHeaders(in, model, response);
+        setBodyAndHeaders(in, responseModel, response);
     }
 
     /*
@@ -128,7 +128,7 @@ class HelsinkiServiceNowServiceCatalogItemsProcessor extends AbstractServiceNowP
      */
     private void checkoutItemGuide(Exchange exchange) throws Exception {
         final Message in = exchange.getIn();
-        final Class<?> model = getModel(in);
+        final Class<?> responseModel = getResponseModel(in);
         final String sysId = in.getHeader(ServiceNowParams.PARAM_SYS_ID.getHeader(), String.class);
 
         Response response = client.reset()
@@ -140,7 +140,7 @@ class HelsinkiServiceNowServiceCatalogItemsProcessor extends AbstractServiceNowP
             .path("submit_guide")
             .invoke(HttpMethod.POST, in.getMandatoryBody());
 
-        setBodyAndHeaders(in, model, response);
+        setBodyAndHeaders(in, responseModel, response);
     }
 
     /*
@@ -154,7 +154,7 @@ class HelsinkiServiceNowServiceCatalogItemsProcessor extends AbstractServiceNowP
      */
     private void addItemToCart(Exchange exchange) throws Exception {
         final Message in = exchange.getIn();
-        final Class<?> model = getModel(in);
+        final Class<?> responseModel = getResponseModel(in);
         final String sysId = in.getHeader(ServiceNowParams.PARAM_SYS_ID.getHeader(), String.class);
 
         Response response = client.reset()
@@ -166,7 +166,7 @@ class HelsinkiServiceNowServiceCatalogItemsProcessor extends AbstractServiceNowP
             .path("add_to_cart")
             .invoke(HttpMethod.POST);
 
-        setBodyAndHeaders(in, model, response);
+        setBodyAndHeaders(in, responseModel, response);
     }
 
     /*
@@ -181,7 +181,7 @@ class HelsinkiServiceNowServiceCatalogItemsProcessor extends AbstractServiceNowP
      */
     private void submitItemProducer(Exchange exchange) throws Exception {
         final Message in = exchange.getIn();
-        final Class<?> model = getModel(in);
+        final Class<?> responseModel = getResponseModel(in);
         final String sysId = in.getHeader(ServiceNowParams.PARAM_SYS_ID.getHeader(), String.class);
 
         Response response = client.reset()
@@ -194,6 +194,6 @@ class HelsinkiServiceNowServiceCatalogItemsProcessor extends AbstractServiceNowP
             .query(ServiceNowParams.SYSPARM_VIEW, in)
             .invoke(HttpMethod.POST, in.getMandatoryBody());
 
-        setBodyAndHeaders(in, model, response);
+        setBodyAndHeaders(in, responseModel, response);
     }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/0902c25e/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/releases/helsinki/HelsinkiServiceNowServiceCatalogProcessor.java
----------------------------------------------------------------------
diff --git a/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/releases/helsinki/HelsinkiServiceNowServiceCatalogProcessor.java b/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/releases/helsinki/HelsinkiServiceNowServiceCatalogProcessor.java
index 152b71f..c7847ab 100644
--- a/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/releases/helsinki/HelsinkiServiceNowServiceCatalogProcessor.java
+++ b/components/camel-servicenow/src/main/java/org/apache/camel/component/servicenow/releases/helsinki/HelsinkiServiceNowServiceCatalogProcessor.java
@@ -53,7 +53,7 @@ class HelsinkiServiceNowServiceCatalogProcessor extends AbstractServiceNowProces
      */
     private void retrieveCatalogs(Exchange exchange) throws Exception {
         final Message in = exchange.getIn();
-        final Class<?> model = getModel(in);
+        final Class<?> responseModel = getResponseModel(in);
         final String sysId = in.getHeader(ServiceNowParams.PARAM_SYS_ID.getHeader(), String.class);
 
         Response response = ObjectHelper.isEmpty(sysId)
@@ -75,7 +75,7 @@ class HelsinkiServiceNowServiceCatalogProcessor extends AbstractServiceNowProces
                 .query(ServiceNowParams.SYSPARM_VIEW, in)
                 .invoke(HttpMethod.GET);
 
-        setBodyAndHeaders(in, model, response);
+        setBodyAndHeaders(in, responseModel, response);
     }
 
     /*
@@ -89,7 +89,7 @@ class HelsinkiServiceNowServiceCatalogProcessor extends AbstractServiceNowProces
      */
     private void retrieveCatalogsCategories(Exchange exchange) throws Exception {
         final Message in = exchange.getIn();
-        final Class<?> model = getModel(in);
+        final Class<?> responseModel = getResponseModel(in);
         final String sysId = in.getHeader(ServiceNowParams.PARAM_SYS_ID.getHeader(), String.class);
 
         Response response = client.reset()
@@ -105,6 +105,6 @@ class HelsinkiServiceNowServiceCatalogProcessor extends AbstractServiceNowProces
             .query(ServiceNowParams.SYSPARM_OFFSET, in)
             .invoke(HttpMethod.GET);
 
-        setBodyAndHeaders(in, model, response);
+        setBodyAndHeaders(in, responseModel, response);
     }
 }


Mime
View raw message