<html>
<head>
    <base href="https://docs.jboss.org/author">
            <link rel="stylesheet" href="/author/s/en/2172/19/5/_/styles/combined.css?spaceKey=TEIID&amp;forWysiwyg=true" type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://docs.jboss.org/author/display/TEIID/Salesforce+Data+Sources">Salesforce Data Sources</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://docs.jboss.org/author/display/~shawkins">Steven Hawkins</a>
    </h4>
        <br/>
                         <h4>Changes (4)</h4>
                                 
    
<div id="page-diffs">
                    <table class="diff" cellpadding="0" cellspacing="0">
    
            <tr><td class="diff-unchanged" >h1. *Salesforce Data Sources* <br> <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">Salesforce data sources use a Teiid specific JCA connector that is deployed into AS {space-metadata-from:asVersionNumber} during installation. There are many ways to create the salesforce data source, using CLI,[AdminShell], admin-console etc. The example shown below uses the CLI tool, as this works in both Standalone and Domain modes. <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">Salesforce data sources use a Teiid specific JCA connector that is deployed into AS {space-metadata-from:asVersionNumber} during installation.  There are two versions of the salesforce resource adapter - salesforce, which currently provides connectivity to the 22.0 Salesforce API and salesforce-34, which provides connectivity to the 34.0 Salesforce API.  The version 22.0 support has been deprecated.   <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">There are many ways to create the salesforce data source, using CLI,[AdminShell], admin-console etc. The example shown below uses the CLI tool, as this works in both Standalone and Domain modes. <br> <br></td></tr>
            <tr><td class="diff-unchanged" >Execute following command using the {space-metadata-from:CLI} once you connected to the Server. Make sure you provide the correct URL and user credentials. Add any additional properties required by the connector by duplicating the &quot;connection-definitions&quot; command below. Edit the JNDI name to match the JNDI name you used in VDB. <br> <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >{code} <br> <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">{note} <br>The salesforce-34 connection definition configuration is similar to the above.  The resource adapter name would instead be salesforce-34, and the url would point to 34.0 instead. <br>{note} <br> <br></td></tr>
            <tr><td class="diff-unchanged" >{info} <br>To find out all the properties that are supported by this Salesforce Connector execute the following command in the CLI. <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <h1><a name="SalesforceDataSources-SalesforceDataSources"></a><b>Salesforce Data Sources</b></h1>

<p>Salesforce data sources use a Teiid specific JCA connector that is deployed into AS 7.5 (EAP 6.4 Alpha) during installation.  There are two versions of the salesforce resource adapter - salesforce, which currently provides connectivity to the 22.0 Salesforce API and salesforce-34, which provides connectivity to the 34.0 Salesforce API.  The version 22.0 support has been deprecated.  </p>

<p>There are many ways to create the salesforce data source, using CLI,<a href="/author/display/TEIID/AdminShell" title="AdminShell">AdminShell</a>, admin-console etc. The example shown below uses the CLI tool, as this works in both Standalone and Domain modes.</p>

<p>Execute following command using the <a href="/author/display/AS72/Admin+Guide#AdminGuide-RunningtheCLI">CLI</a> once you connected to the Server. Make sure you provide the correct URL and user credentials. Add any additional properties required by the connector by duplicating the "connection-definitions" command below. Edit the JNDI name to match the JNDI name you used in VDB.</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Confluence; brush: java; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">
batch
/subsystem=resource-adapters/resource-adapter=salesforce/connection-definitions=sfDS:add(jndi-name=java:/sfDS, class-name=org.teiid.resource.adapter.salesforce.SalesForceManagedConnectionFactory, enabled=true, use-java-context=true)
/subsystem=resource-adapters/resource-adapter=salesforce/connection-definitions=sfDS/config-properties=URL:add(value=https://www.salesforce.com/services/Soap/u/22.0)
/subsystem=resource-adapters/resource-adapter=salesforce/connection-definitions=sfDS/config-properties=username:add(value={user})
/subsystem=resource-adapters/resource-adapter=salesforce/connection-definitions=sfDS/config-properties=password:add(value={password})
/subsystem=resource-adapters/resource-adapter=salesforce:activate
runbatch
</pre>
</div></div>

<div class='panelMacro'><table class='noteMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/author/images/icons/emoticons/warning.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td>The salesforce-34 connection definition configuration is similar to the above.  The resource adapter name would instead be salesforce-34, and the url would point to 34.0 instead.</td></tr></table></div>

<div class='panelMacro'><table class='infoMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/author/images/icons/emoticons/information.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td>To find out all the properties that are supported by this Salesforce Connector execute the following command in the CLI.
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Confluence; brush: java; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">
/subsystem=teiid:read-rar-description(rar-name=salesforce)
</pre>
</div></div></td></tr></table></div>

<div class='panelMacro'><table class='tipMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/author/images/icons/emoticons/check.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b>Developer's Tip</b><br />If the JBoss AS 7.5 (EAP 6.4 Alpha) is running in standalone mode, you can also manually edit the "&lt;jboss-install&gt;/standalone/configuration/standalone-teiid.xml" file and add the XML configuration defined in "&lt;jboss-install&gt;/docs/teiid/datasources/salesforce" directory under "resource-adapters" subsystem. Shutdown the server before you edit this file, and restart after the modifications are done.</td></tr></table></div>

<h2><a name="SalesforceDataSources-MutualAuthentication"></a>Mutual Authentication</h2>

<p>If you need to connect to Salesforce using Mutual Authentication, follow the directions to setup Salesforce at <a href="https://help.salesforce.com/apex/HTViewHelpDoc?id=security_keys_uploading_mutual_auth_cert.htm&amp;language=en_US" class="external-link" rel="nofollow">https://help.salesforce.com/apex/HTViewHelpDoc?id=security_keys_uploading_mutual_auth_cert.htm&amp;language=en_US</a> then configure the below CXF configuration file on the resource-adapter by adding following property to above cli script</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Confluence; brush: java; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">
/subsystem=resource-adapters/resource-adapter=salesforce/connection-definitions=sfDS/config-properties=ConfigFile:add(value=${jboss.server.config.dir}/cxf-https.xml)
</pre>
</div></div> 
<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;"><b>cxf-https.xml</b></div><div class="codeContent panelContent">
<pre class="theme: Confluence; brush: java; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">
&lt;beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:sec="http://cxf.apache.org/configuration/security"
    xmlns:http-conf="http://cxf.apache.org/transports/http/configuration"
    xmlns:jaxws="http://java.sun.com/xml/ns/jaxws"
    xsi:schemaLocation="http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://cxf.apache.org/configuration/security http://cxf.apache.org/schemas/configuration/security.xsd"&gt;
  
    &lt;http-conf:conduit name="*.http-conduit"&gt;
        &lt;http-conf:client ConnectionTimeout="120000" ReceiveTimeout="240000"/&gt;
        &lt;http-conf:tlsClientParameters secureSocketProtocol="SSL"&gt;
          &lt;sec:trustManagers&gt;
            &lt;sec:keyStore type="JKS" password="changeit" file="/path/to/truststore.jks"/&gt;
          &lt;/sec:trustManagers&gt;
        &lt;/http-conf:tlsClientParameters&gt;
    &lt;/http-conf:conduit&gt;
&lt;/beans&gt;
</pre>
</div></div>
<p>more information about CXF configuration file can be found at <a href="http://cxf.apache.org/docs/client-http-transport-including-ssl-support.html#ClientHTTPTransport(includingSSLsupport)-ConfiguringSSLSupport" class="external-link" rel="nofollow">http://cxf.apache.org/docs/client-http-transport-including-ssl-support.html#ClientHTTPTransport(includingSSLsupport)-ConfiguringSSLSupport</a></p>
    </div>
        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;" class="grey">
                        <a href="https://docs.jboss.org/author/users/removespacenotification.action?spaceKey=TEIID">Stop watching space</a>
            <span style="padding: 0px 5px;">|</span>
                <a href="https://docs.jboss.org/author/users/editmyemailsettings.action">Change email notification preferences</a>
</div>
        <a href="https://docs.jboss.org/author/display/TEIID/Salesforce+Data+Sources">View Online</a>
        |
        <a href="https://docs.jboss.org/author/pages/diffpagesbyversion.action?pageId=55476957&revisedVersion=11&originalVersion=10">View Changes</a>
                |
        <a href="https://docs.jboss.org/author/display/TEIID/Salesforce+Data+Sources?showComments=true&amp;showCommentArea=true#addcomment">Add Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>