Source:
private String createUser(ProvisioningEntity provisioningEntity) throws IdentityProvisioningException { boolean isDebugEnabled = log.isDebugEnabled(); HttpClient httpclient = new HttpClient(); JSONObject user = buildJsonObject(provisioningEntity); PostMethod post = new PostMethod(this.getUserObjectEndpoint()); setAuthorizationHeader(post); try { post.setRequestEntity(new StringRequestEntity(user.toString(), SalesforceConnectorConstants.CONTENT_TYPE_APPLICATION_JSON, null)); } catch (UnsupportedEncodingException e) { log.error("Error in encoding provisioning request"); throw new IdentityProvisioningException(e); } String provisionedId = null; try { httpclient.executeMethod(post); if (isDebugEnabled) { log.debug("HTTP status " + post.getStatusCode() + " creating user"); } if (post.getStatusCode() == HttpStatus.SC_CREATED) { JSONObject response = new JSONObject(new JSONTokener(new InputStreamReader( post.getResponseBodyAsStream()))); if (isDebugEnabled) { log.debug("Create response: " + response.toString(2)); } if (response.getBoolean("success")) { provisionedId = response.getString("id"); if (isDebugEnabled) { log.debug("New record id " + provisionedId); } } } else { log.error("recieved response status code :" + post.getStatusCode() + " text : " + post.getStatusText()); if (isDebugEnabled) { log.debug("Error response : " + readResponse(post)); } } } catch (HttpException | IOException | JSONException e) { log.error("Error in invoking provisioning operation for the user"); throw new IdentityProvisioningException(e); } finally { post.releaseConnection(); } if (isDebugEnabled) { log.debug("Returning created user's ID : " + provisionedId); } return provisionedId; }

Target:
private String createUser(ProvisioningEntity provisioningEntity) throws IdentityProvisioningException { boolean isDebugEnabled = log.isDebugEnabled(); HttpClient httpclient = new HttpClient(); JSONObject user = buildJsonObject(provisioningEntity); PostMethod post = new PostMethod(this.getUserObjectEndpoint()); setAuthorizationHeader(post); try { post.setRequestEntity(new StringRequestEntity(user.toString(), SalesforceConnectorConstants.CONTENT_TYPE_APPLICATION_JSON, null)); } catch (UnsupportedEncodingException e) { log.error("Error in encoding provisioning request"); throw new IdentityProvisioningException(e); } String provisionedId = null; try { httpclient.executeMethod(post); if (isDebugEnabled) { log.debug("HTTP status " + post.getStatusCode() + " creating user"); } if (post.getStatusCode() == HttpStatus.SC_CREATED) { JSONObject response = new JSONObject(new JSONTokener(new InputStreamReader( post.getResponseBodyAsStream()))); if (isDebugEnabled) { log.debug("Create response: " + response.toString(2)); } if (response.getBoolean("success")) { provisionedId = response.getString("id"); if (isDebugEnabled) { log.debug("New record id " + provisionedId); } } } else { log.error("recieved response status code :" + post.getStatusCode() + " text : " + post.getStatusText()); if (isDebugEnabled) { log.debug("Error response : " + readResponse(post)); } } } catch (HttpException | IOException | JSONException e) { throw new IdentityProvisioningException("Error in invoking provisioning operation for the user", e); } finally { post.releaseConnection(); } if (isDebugEnabled) { log.debug("Returning created user's ID : " + provisionedId); } return provisionedId; }