<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/~rareddy">Ramesh Reddy</a>
    </h4>
        <div id="versionComment">
        <b>Comment:</b>
        TEIID-3493<br />
    </div>
        <br/>
                         <h4>Changes (2)</h4>
                                 
    
<div id="page-diffs">
                    <table class="diff" cellpadding="0" cellspacing="0">
    
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >{info} <br> <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">{warning} <br>As of AS 7.1 CR1b release the above does not work without restarting the Server. This issue will be fixed before 7.2 Final. <br>{warning} <br> <br></td></tr>
            <tr><td class="diff-unchanged" >{tip:title=Developer&#39;s Tip} <br>If the JBoss AS {space-metadata-from:asVersionNumber} is running in standalone mode, you can also manually edit the &quot;&lt;jboss-install&gt;/standalone/configuration/standalone-teiid.xml&quot; file and add the XML configuration defined in &quot;&lt;jboss-install&gt;/docs/teiid/datasources/salesforce&quot; directory under &quot;resource-adapters&quot; subsystem. Shutdown the server before you edit this file, and restart after the modifications are done. <br>{tip} <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;"> <br>h2. Mutual Authentication <br> <br>If you need to connect to Salesforce using Mutual Authentication, follow the directions to setup Salesforce at [https://help.salesforce.com/apex/HTViewHelpDoc?id=security_keys_uploading_mutual_auth_cert.htm&amp;language=en_US] then configure the below CXF configuration file on the resource-adapter by adding following property to above cli script <br>{code} <br>/subsystem=resource-adapters/resource-adapter=salesforce/connection-definitions=sfDS/config-properties=ConfigFile:add(value=${jboss.server.config.dir}/cxf-https.xml) <br>{code}  <br>{code:title=cxf-https.xml} <br>&lt;beans xmlns=&quot;http://www.springframework.org/schema/beans&quot; <br>    xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; <br>    xmlns:sec=&quot;http://cxf.apache.org/configuration/security&quot; <br>    xmlns:http-conf=&quot;http://cxf.apache.org/transports/http/configuration&quot; <br>    xmlns:jaxws=&quot;http://java.sun.com/xml/ns/jaxws&quot; <br>    xsi:schemaLocation=&quot;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&quot;&gt; <br> <br>    &lt;http-conf:conduit name=&quot;*.http-conduit&quot;&gt; <br>        &lt;http-conf:client ConnectionTimeout=&quot;120000&quot; ReceiveTimeout=&quot;240000&quot;/&gt; <br>        &lt;http-conf:tlsClientParameters secureSocketProtocol=&quot;SSL&quot;&gt; <br>          &lt;sec:trustManagers&gt; <br>            &lt;sec:keyStore type=&quot;JKS&quot; password=&quot;changeit&quot; file=&quot;/path/to/truststore.jks&quot;/&gt; <br>          &lt;/sec:trustManagers&gt; <br>        &lt;/http-conf:tlsClientParameters&gt; <br>    &lt;/http-conf:conduit&gt; <br>&lt;/beans&gt; <br>{code} <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 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='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>
    </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=9&originalVersion=8">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>