<html>
<head>
<base href="https://docs.jboss.org/author">
<link rel="stylesheet" href="/author/s/en/2172/19/5/_/styles/combined.css?spaceKey=TEIID&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>added</b> by <a href="https://docs.jboss.org/author/display/~van.halbert">Van Halbert</a>
</h4>
<br/>
<div class="notificationGreySide">
<h1><a name="SalesforceDataSources-"></a><font color="#000000"><b>Salesforce Data Sources</b></font></h1>
<p><font color="#333333">Salesforce data sources use a Teiid specific JCA connector "teiid-connector-salesforce.rar", which is deployed into the AS7.x during installation. There are many ways to create the salesforce data source, using CLI,</font><font color="#005e8f">[<font color="#005e8f"></font>AdminShell</font>|AdminShell]<font color=""><font color="#333333"></font>, admin-console etc. The example shown below uses the CLI tool, as this works in both Standalone and Domain modes.</font></p>
<p><font color="#333333">Execute following command using </font><font color="#005e8f">[<font color="#005e8f"></font>CLI</font>|https://docs.jboss.org/author/display/AS7/Admin+Guide#AdminGuide-RunningtheCLI]<font color=""><font color="#333333"></font> 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.</font></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=sfDS:add(archive=teiid-connector-salesforce.rar, transaction-support=NoTransaction)
/subsystem=resource-adapters/resource-adapter=sfDS/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=sfDS/connection-definitions=sfDS/config-properties=URL:add(value=https://www.salesforce.com/services/Soap/u/22.0)
/subsystem=resource-adapters/resource-adapter=sfDS/connection-definitions=sfDS/config-properties=username:add(value={user})
/subsystem=resource-adapters/resource-adapter=sfDS/connection-definitions=sfDS/config-properties=password:add(value={password})
/subsystem=resource-adapters/resource-adapter=sfDS/connection-definitions=sfDS:enable
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><font color="#333333">To find out all the properties that are supported by this Salesforce Connector execute the following command in the CLI.</font><br/>
<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=teiid-connector-salesforce.rar)</pre>
</div></div><font color="#333333"> </font></td></tr></table></div>
<div class='panelMacro'><table class='warningMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/author/images/icons/emoticons/forbidden.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><font color="#333333">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.</font></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 /><font color="#333333">If the JBoss AS 7.x is running in standalone mode, you can also manually edit the "<jboss-install>/standalone/configuration/standalone-teiid.xml" file and add the XML configuration defined in "<jboss-install>/docs/teiid/datasources/salesforce" directory under "resource-adapters" subsystem. Shutdown the server before you edit this file, and restart after the modifications are done.</font></td></tr></table></div>
<h3><a name="SalesforceDataSources-"></a><font color="#000000"><b>CXF Configuration</b></font></h3>
<p><font color="#333333">Salesforce service data source may choose a particular CXF config file and port configuration. The </font><font color="#333333"><tt>ConfigFile</tt></font><font color="#333333"> config property specifies the Spring XML configuration file for the CXF Bus and port configuration to be used by connections. If no config file is specified then the system default configuration will be used.</font></p>
<p><font color="#333333">Only 1 port configuration can be used by this data source. The namespace URI for the QName in your config file should be "urn:partner.soap.sforce.com", with configuration name "Soap". For sample cxf configuration file and details on configuration see </font><font color="#005e8f">[<font color="#005e8f"></font>Web Service Data Sources</font>|Web Service Data Sources]<font color=""><br/>
<br/>
<font color="#333333"></font>See the </font><font color="#005e8f">[<font color="#005e8f"></font>CXF documentation</font>|http://cxf.apache.org/docs/]<font color=""><font color="#333333"></font> for all possible configuration options.</font></p>
<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><font color="#333333">The CXF configuration in Salesforce data source is only used for http bus configuration not for purposes of ws-security, Salesforce has its own security authentication.</font></td></tr></table></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/display/TEIID/Salesforce+Data+Sources?showComments=true&showCommentArea=true#addcomment">Add Comment</a>
</div>
</div>
</div>
</div>
</div>
</body>
</html>