<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/Web+Service+Data+Sources">Web Service Data Sources</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://docs.jboss.org/author/display/~rareddy">Ramesh Reddy</a>
    </h4>
        <br/>
                         <h4>Changes (1)</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" > <br>for all the http-conduit based configuration see [http://cxf.apache.org/docs/client-http-transport-including-ssl-support.html|http://cxf.apache.org/docs/client-http-transport-including-ssl-support.html]. You can also configure for HTTPBasic, kerberos, etc. <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;"> <br>h3. Kerberos with REST based Services <br> <br>{tip:title=&quot;Kerberos in ws-security with SOAP services&quot;} <br>Check out the cxf configuration to allow Kerberos in SOAP web services at http://cxf.apache.org/docs/security.html <br>{tip} <br> <br>The kerberos support is based SPNEGO as described in [http://cxf.apache.org/docs/client-http-transport-including-ssl-support.html#ClientHTTPTransport%28includingSSLsupport%29-SpnegoAuthentication%28Kerberos%29]. There two types of kerberos support <br> <br>*Negotiation* - With this configuration, REST service is configured with Kerberos JAAS domain, to negotiate a token, then use it access the web service. For this first create a security domain in standalone.xml file as below <br> <br>{code} <br>&lt;security-domain name=&quot;MY_REALM&quot; cache-type=&quot;default&quot;&gt; <br>     &lt;authentication&gt; <br>         &lt;login-module code=&quot;Kerberos&quot; flag=&quot;required&quot;&gt; <br>             &lt;module-option name=&quot;storeKey&quot; value=&quot;true&quot;/&gt; <br> <br>             &lt;module-option name=&quot;useKeyTab&quot; value=&quot;true&quot;/&gt; <br>             &lt;module-option name=&quot;keyTab&quot; value=&quot;/home/username/service.keytab&quot;/&gt; <br>             &lt;module-option name=&quot;principal&quot; value=&quot;host/testserver@MY_REALM&quot;/&gt; <br> <br>             &lt;module-option name=&quot;doNotPrompt&quot; value=&quot;true&quot;/&gt; <br>             &lt;module-option name=&quot;debug&quot; value=&quot;false&quot;/&gt; <br>         &lt;/login-module&gt; <br>     &lt;/authentication&gt; <br>&lt;/security-domain&gt;  <br>{code} <br> <br>and the jboss-cxf-xxx.xml file needs to be set as <br> <br>{code} <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>        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:authorization&gt; <br>               &lt;sec:AuthorizationType&gt;Negotiate&lt;/sec:AuthorizationType&gt; <br>               &lt;sec:Authorization&gt;MY_REALM&lt;/sec:Authorization&gt; <br>           &lt;/http-conf:authorization&gt; <br>       &lt;/http-conf:conduit&gt; <br>&lt;/beans&gt; <br>{code} <br> <br>The resource adapter creation needs to define the following properties <br> <br>{code} <br>   &lt;config-property name=&quot;ConfigFile&quot;&gt;path/to/jboss-cxf-xxxx.xml&lt;/config-property&gt; <br>   &lt;config-property name=&quot;ConfigName&quot;&gt;test&lt;/config-property&gt; <br>{code} <br> <br>{warning} <br>Even though above configuration configures the value of &quot;ConfigName&quot;, the cxf framework currently in the case of JAX-RS client does not give option to use it. For that reason use &quot;*.http-conduit&quot; which will apply to all the HTTP communications under this resource adapter. <br>{warning} <br> <br>*Delegation* - If in case the user is already logged into Teiid using Kerberos using JDBC/ODBC or used SPNEGO in web-tier and used pass-through authentication into Teiid, then there is no need to negotiate a new token for the Kerberos. The system can delegate the existing token. <br> <br>To configure for delegation, set up security domain defined exactly as defined in &quot;negotiation&quot;, and jboss-cxf-xxx.xml file, however remove the following line from jboss-cxf-xxx.xml file, as it is not going to negotiate new token. <br> <br>{code} <br>  &lt;sec:Authorization&gt;MY_REALM&lt;/sec:Authorization&gt; <br>{code} <br> <br>Add the following properties in web service resource adapter creation. One configures that &quot;kerberos&quot; security being used, the second defines a security domain to be used at the data source, in this case we want to use a security domain that passes through a logged in user <br>{code} <br>   &lt;config-property name=&quot;SecurityType&quot;&gt;Kerberos&lt;/config-property&gt; <br>   &lt;security&gt;   <br>        &lt;security-domain&gt;passthrough-security&lt;/security-domain&gt;   <br>   &lt;/security&gt;  <br>{code} <br> <br>To configure in &quot;passthrough-security&quot; security domain, the &quot;security&quot; subsystem add following XML fragment <br> <br>{code} <br>&lt;security-domain name=&quot;passthrough-security&quot; cache-type=&quot;default&quot;&gt;   <br>    &lt;authentication&gt;   <br>        &lt;login-module code=&quot;org.teiid.jboss.PassthroughIdentityLoginModule&quot; flag=&quot;required&quot; module=&quot;org.jboss.teiid&quot;&gt;   <br>            &lt;module-option name=&quot;username&quot; value=&quot;guest&quot;/&gt;   <br>            &lt;module-option name=&quot;password&quot; value=&quot;guest&quot;/&gt;   <br>        &lt;/login-module&gt;   <br>    &lt;/authentication&gt;   <br>&lt;/security-domain&gt;   <br>{code} <br> <br>The username, password are optional, if in case there is no authenticated subject available in the context, these can help create a simple static user, but that user will not work with kerberos authentication as the subject will not have the kerberos token required. <br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <h1><a name="WebServiceDataSources-%7B%7DWebServiceDataSources%7B%7D"></a><b>Web Service Data Sources</b></h1>

<p>Web service data sources use a Teiid specific JCA connector that is deployed into AS 7.4 (EAP 6.3 Alpha) during installation. There are many ways to create the file data source, using CLI,&nbsp;<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 endpoint and other properties below. 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=webservice/connection-definitions=wsDS:add(jndi-name=java:/wsDS, class-name=org.teiid.resource.adapter.ws.WSManagedConnectionFactory, enabled=true, use-java-context=true)
/subsystem=resource-adapters/resource-adapter=webservice/connection-definitions=wsDS/config-properties=EndPoint:add(value={end_point})
/subsystem=resource-adapters/resource-adapter=webservice: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 Web Service 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=webservice)
</pre>
</div></div>
<p>The Web Service Data Source supports specifying a WSDL using the Wsdl property.&nbsp; If the Wsdl property is set, then the ServiceName, EndPointName, and NamespaceUri properties should also be set.&nbsp; The Wsdl property may be a URL or file location or the WSDL to use.</p></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>As of AS 7.1 CR1b release the above does not work without restarting the Server. This issue will be fixed in Wildfly.</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.4 (EAP 6.3 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/web-service" directory under "resource-adapters" subsystem. Shutdown the server before you edit this file, and restart after the modifications are done.</td></tr></table></div>

<h3><a name="WebServiceDataSources-Allavailableconfigurationpropertiesofwebresourceadapter"></a>All available configuration properties of web resource-adapter</h3>

<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'>Property Name</th>
<th class='confluenceTh'>applies to</th>
<th class='confluenceTh'>Required</th>
<th class='confluenceTh'>Default Value</th>
<th class='confluenceTh'>Description</th>
</tr>
<tr>
<td class='confluenceTd'>EndPoint</td>
<td class='confluenceTd'>HTTP &amp; SOAP</td>
<td class='confluenceTd'>true</td>
<td class='confluenceTd'>n/a</td>
<td class='confluenceTd'>URL for HTTP, Service Endpoint for SOAP</td>
</tr>
<tr>
<td class='confluenceTd'>SecurityType</td>
<td class='confluenceTd'>HTTP &amp; SOAP</td>
<td class='confluenceTd'>false</td>
<td class='confluenceTd'>none</td>
<td class='confluenceTd'>Type of Authentication to used with the web service. Allowed values<a href="/author/pages/createpage.action?spaceKey=TEIID&amp;title=%22None%22%2C%22HTTPBasic%22%2C%22WSSecurity%22%2C+%22Kerberos%22&amp;linkCreation=true&amp;fromPageId=55476955" class="createlink">"None","HTTPBasic","WSSecurity", "Kerberos"</a></td>
</tr>
<tr>
<td class='confluenceTd'>AuthUserName</td>
<td class='confluenceTd'>HTTP &amp; SOAP</td>
<td class='confluenceTd'>false</td>
<td class='confluenceTd'>n/a</td>
<td class='confluenceTd'>Name value for authentication, used in HTTPBasic and WsSecurity</td>
</tr>
<tr>
<td class='confluenceTd'>AuthPassword</td>
<td class='confluenceTd'>HTTP &amp; SOAP</td>
<td class='confluenceTd'>false</td>
<td class='confluenceTd'>n/a</td>
<td class='confluenceTd'>Password value for authentication, used in HTTPBasic and WsSecurity</td>
</tr>
<tr>
<td class='confluenceTd'>ConfigFile</td>
<td class='confluenceTd'>HTTP &amp; SOAP</td>
<td class='confluenceTd'>false</td>
<td class='confluenceTd'>n/a</td>
<td class='confluenceTd'>CXF client configuration File or URL</td>
</tr>
<tr>
<td class='confluenceTd'>EndPointName</td>
<td class='confluenceTd'>HTTP &amp; SOAP</td>
<td class='confluenceTd'>false</td>
<td class='confluenceTd'>teiid</td>
<td class='confluenceTd'>Local part of the end point QName to use with this connection, needs to match one defined in cxf file</td>
</tr>
<tr>
<td class='confluenceTd'>ServiceName</td>
<td class='confluenceTd'>SOAP</td>
<td class='confluenceTd'>false</td>
<td class='confluenceTd'>n/a</td>
<td class='confluenceTd'>Local part of the service QName to use with this connection</td>
</tr>
<tr>
<td class='confluenceTd'>NamespaceUri</td>
<td class='confluenceTd'>SOAP</td>
<td class='confluenceTd'>false</td>
<td class='confluenceTd'>http://teiid.org</td>
<td class='confluenceTd'>Namespace URI of the service QName to use with this connection</td>
</tr>
<tr>
<td class='confluenceTd'>RequestTimeout</td>
<td class='confluenceTd'>HTTP &amp; SOAP</td>
<td class='confluenceTd'>false</td>
<td class='confluenceTd'>n/a</td>
<td class='confluenceTd'>Timeout for request</td>
</tr>
<tr>
<td class='confluenceTd'>ConnectTimeout</td>
<td class='confluenceTd'>HTTP &amp; SOAP</td>
<td class='confluenceTd'>false</td>
<td class='confluenceTd'>n/a</td>
<td class='confluenceTd'>Timeout for connection</td>
</tr>
<tr>
<td class='confluenceTd'>Wsdl</td>
<td class='confluenceTd'>SOAP</td>
<td class='confluenceTd'>false</td>
<td class='confluenceTd'>n/a</td>
<td class='confluenceTd'>WSDL file or URL for the web service</td>
</tr>
</tbody></table>
</div>


<h3><a name="WebServiceDataSources-CXFConfiguration"></a><b>CXF Configuration</b></h3>

<p>Each web service data source may choose a particular CXF config file and port configuration. The <tt>ConfigFile</tt> 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.</p>

<p>Only 1 port configuration can be used by this data source. You may explicitly set the local name of the port QName to use via the <tt>ConfigName</tt> property. The namespace URI for the QName in your config file should match your WSDL/namespace setting on the data source or use the default of <a href="http://teiid.org" class="external-link" rel="nofollow">http://teiid.org</a>. See the <a href="http://cxf.apache.org/docs/configuration.html" class="external-link" rel="nofollow">CXF Documentation</a> and the sections below on <a href="#WebServiceDataSources-WSSecurity">WS&#45;Security</a>, <a href="#WebServiceDataSources-Logging">Logging</a>, etc. for examples of using the CXF configuration file.</p>
<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;"><b>Sample Spring XML Configuration To Set Timeouts</b></div><div class="codeContent panelContent">
<pre class="theme: Confluence; brush: xml; 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:http-conf="http://cxf.apache.org/transports/http/configuration"
                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.xsd"&gt;

        &lt;http-conf:conduit name="{http://teiid.org}configName.http-conduit"&gt;
                &lt;http-conf:client ConnectionTimeout="120000" ReceiveTimeout="240000"/&gt;
        &lt;/http-conf:conduit&gt;
&lt;/beans&gt;
</pre>
</div></div>

<p>In the conduit name {<a href="http://teiid.org" class="external-link" rel="nofollow">http://teiid.org</a>}configName.http-conduit, the namespace, {<a href="http://teiid.org" class="external-link" rel="nofollow">http://teiid.org</a>}, may be set via the namespace datasource property.  Typically that will only need done when also supplying the wsdl setting. The local name is followed by .http-conduit. It will be based upon the configName setting, with a default value of teiid.</p>

<p>See the <a href="http://cxf.apache.org/docs/" class="external-link" rel="nofollow">CXF documentation</a> for all possible configuration options.</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>It is not required to use the Spring configuration to set just timeouts.  The ConnectionTimeout and ReceiveTimeout can be set via the resource adapter connectTimeout and requestTimeout properties respectively.</td></tr></table></div>

<h3><a name="WebServiceDataSources-WSSecurity"></a><b>WS-Security</b></h3>

<p>To enable the use of WS-Security, the <tt>SecurityType</tt> should be set to WSSecurity. At this time Teiid does not expect a WSDL to describe the service being used. Thus a Spring XML configuration file is not only required, it must instead contain all of the relevant policy configuration. And just as with the general configuration, each data source is limited to specifying only a single port configuration to use.</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=webservice/connection-definitions=wsDS:add(jndi-name=java:/wsDS, class-name=org.teiid.resource.adapter.ws.WSManagedConnectionFactory, enabled=true, use-java-context=true)
/subsystem=resource-adapters/resource-adapter=webservice/connection-definitions=wsDS/config-properties=ConfigFile:add(value=${jboss.server.home.dir}/standalone/configuration/xxx-jbossws-cxf.xml)
/subsystem=resource-adapters/resource-adapter=webservice/connection-definitions=wsDS/config-properties=ConfigName:add(value=port_x)
/subsystem=resource-adapters/resource-adapter=webservice/connection-definitions=wsDS/config-properties=SecurityType:add(value=WSSecurity)
/subsystem=resource-adapters/resource-adapter=webservice:activate
runbatch
</pre>
</div></div>

<p>The corresponding xxx-jbossws-cxf.xml file that adds a timestamp to the SOAP header</p>

<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;"><b>Example WS-Security enabled data source</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:jaxws="http://cxf.apache.org/jaxws"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
          http://www.springframework.org/schema/beans/spring-beans.xsd
          http://cxf.apache.org/jaxws
          http://cxf.apache.org/schemas/jaxws.xsd"&gt;

    &lt;jaxws:client name="{http://teiid.org}port_x"
        createdFromAPI="true"&gt;
        &lt;jaxws:outInterceptors&gt;
            &lt;bean/&gt;
            &lt;ref bean="Timestamp_Request"/&gt;
        &lt;/jaxws:outInterceptors&gt;
    &lt;/jaxws:client&gt;

    &lt;bean

        id="Timestamp_Request"&gt;
        &lt;constructor-arg&gt;
            &lt;map&gt;
                &lt;entry key="action" value="Timestamp"/&gt;
            &lt;map&gt;
        &lt;/constructor-arg&gt;
    &lt;/bean&gt;

&lt;/beans&gt;
</pre>
</div></div>

<p>Note that the client port configuration is matched to the data source instance by the QName {<a href="http://teiid.org" class="external-link" rel="nofollow">http://teiid.org</a>}port_x, where the namespace will match your namespace setting or the default of <a href="http://teiid.org" class="external-link" rel="nofollow">http://teiid.org</a>. The configuration may contain other port configurations with different local names.</p>

<p>For more information on configuring CXF interceptors, please consult the&nbsp;<a href="http://cxf.apache.org/docs/security.html" class="external-link" rel="nofollow">CXF documentation</a></p>

<h4><a name="WebServiceDataSources-Kerberos"></a>Kerberos</h4>

<p>WS-Security Kerberos is only supported when the WSDL property is defined in resource-adapter connection configuration and only when WSDL Based Procedures are used. WSDL file must contain WS-Policy section, then WS-Policy section is correctly interpreted and enforced on the endpoint. The sample CXF configuration will look like</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;">
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;beans xmlns="http://www.springframework.org/schema/beans" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:http="http://cxf.apache.org/transports/http/configuration" 
    xmlns:jaxws="http://cxf.apache.org/jaxws" 
    xmlns:cxf="http://cxf.apache.org/core" 
    xmlns:p="http://cxf.apache.org/policy" 
    xmlns:sec="http://cxf.apache.org/configuration/security" 
    xsi:schemaLocation="http://www.springframework.org/schema/beans           http://www.springframework.org/schema/beans/spring-beans.xsd           http://cxf.apache.org/jaxws                           http://cxf.apache.org/schemas/jaxws.xsd           http://cxf.apache.org/transports/http/configuration   http://cxf.apache.org/schemas/configuration/http-conf.xsd           http://cxf.apache.org/configuration/security          http://cxf.apache.org/schemas/configuration/security.xsd           http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd           http://cxf.apache.org/policy http://cxf.apache.org/schemas/policy.xsd"&gt;
    &lt;bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/&gt;
    &lt;cxf:bus&gt;
        &lt;cxf:features&gt;
            &lt;p:policies/&gt;
            &lt;cxf:logging/&gt;
        &lt;/cxf:features&gt;
    &lt;/cxf:bus&gt;

    &lt;jaxws:client name="{http://webservices.samples.jboss.org/}HelloWorldPort" createdFromAPI="true"&gt;
        &lt;jaxws:properties&gt;
            &lt;entry key="ws-security.kerberos.client"&gt;
                &lt;bean class="org.apache.cxf.ws.security.kerberos.KerberosClient"&gt;
                    &lt;constructor-arg ref="cxf"/&gt;
                    &lt;property name="contextName" value="alice"/&gt;
                    &lt;property name="serviceName" value="bob@service.example.com"/&gt;
                &lt;/bean&gt;
            &lt;/entry&gt;
        &lt;/jaxws:properties&gt;
    &lt;/jaxws:client&gt;
&lt;/beans&gt;
</pre>
</div></div>

<p>and you would need to configure the security-domain in the standalone-teiid.xml file under 'security' subsystem as</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;">
&lt;security-domain name="alice" cache-type="default"&gt;
    &lt;authentication&gt;
        &lt;login-module code="Kerberos" flag="required"&gt;
            &lt;module-option name="storeKey" value="true"/&gt;
            &lt;module-option name="useKeyTab" value="true"/&gt;
            &lt;module-option name="keyTab" value="/home/alice/alice.keytab"/&gt;
            &lt;module-option name="principal" value="alice@EXAMPLE.COM"/&gt;
            &lt;module-option name="doNotPrompt" value="true"/&gt;
            &lt;module-option name="debug" value="true"/&gt;
            &lt;module-option name="refreshKrb5Config" value="true"/&gt;
        &lt;/login-module&gt;
    &lt;/authentication&gt;
&lt;/security-domain&gt;
</pre>
</div></div>
<p>for complete list of kerberos properties please refer to <a href="http://anonsvn.jboss.org/repos/jbossws/stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/kerberos/KerberosTestCase.java" class="external-link" rel="nofollow">this testcase</a></p>

<h3><a name="WebServiceDataSources-Logging"></a><b>Logging</b></h3>

<p>The CXF config property may also be used to control the logging of requests and responses for specific or all ports. Logging, when enabled, will be performed at an INFO level to the org.apache.cxf.interceptor context.</p>

<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;"><b>Example logging data source</b></div><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=webservice/connection-definitions=wsDS:add(jndi-name=java:/wsDS, class-name=org.teiid.resource.adapter.ws.WSManagedConnectionFactory, enabled=true, use-java-context=true)
/subsystem=resource-adapters/resource-adapter=webservice/connection-definitions=wsDS/config-properties=ConfigFile:add(value=${jboss.server.home.dir}/standalone/configuration/xxx-jbossws-cxf.xml)
/subsystem=resource-adapters/resource-adapter=webservice/connection-definitions=wsDS/config-properties=ConfigName:add(value=port_x)
/subsystem=resource-adapters/resource-adapter=webservice:activate
runbatch
</pre>
</div></div>

<p>Corresponding xxx-jbossws-cxf.xml</p>
<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;"><b>Example logging data source</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:jaxws="http://cxf.apache.org/jaxws"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
          http://www.springframework.org/schema/beans/spring-beans.xsd
          http://cxf.apache.org/jaxws
          http://cxf.apache.org/schemas/jaxws.xsd"&gt;

    &lt;jaxws:client name="{http://teiid.org}port_y"
        createdFromAPI="true"&gt;
        &lt;jaxws:features&gt;
            &lt;bean class="org.apache.cxf.feature.LoggingFeature"/&gt;
        &lt;/jaxws:features&gt;
    &lt;/jaxws:client&gt;

&lt;/beans&gt;</pre>
</div></div>

<h3><a name="WebServiceDataSources-TransportSettings"></a><b>Transport Settings</b></h3>

<p>The CXF config property may also be used to control low level aspects of the HTTP transport. See the&nbsp;<a href="http://cxf.apache.org/docs/client-http-transport-including-ssl-support.html" class="external-link" rel="nofollow">CXF documentation</a>&nbsp;for all possible options.</p>
<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;"><b>Example Disabling Hostname Verification</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:http-conf="http://cxf.apache.org/transports/http/configuration"
       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.xsd"&gt;

  &lt;http-conf:conduit name="{http://teiid.org}port_z.http-conduit"&gt;
     &lt;!-- WARNING ! disableCNcheck=true should NOT be used in production --&gt;
     &lt;http-conf:tlsClientParameters disableCNcheck="true" /&gt;

  &lt;/http-conf:conduit&gt;
&lt;/beans&gt;
</pre>
</div></div>

<h3><a name="WebServiceDataSources-ConfiguringSSLSupport%28Https%29"></a>Configuring SSL Support (Https)</h3>
<p>For using the HTTPS, you can configure CXF file as below</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;">
&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>for all the http-conduit based configuration see <a href="http://cxf.apache.org/docs/client-http-transport-including-ssl-support.html" class="external-link" rel="nofollow">http://cxf.apache.org/docs/client-http-transport-including-ssl-support.html</a>. You can also configure for HTTPBasic, kerberos, etc.</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/Web+Service+Data+Sources">View Online</a>
        |
        <a href="https://docs.jboss.org/author/pages/diffpagesbyversion.action?pageId=55476955&revisedVersion=19&originalVersion=18">View Changes</a>
                |
        <a href="https://docs.jboss.org/author/display/TEIID/Web+Service+Data+Sources?showComments=true&amp;showCommentArea=true#addcomment">Add Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>