cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache CXF Documentation > Server, Service, and Client FactoryBeans
Date Mon, 28 Jan 2013 16:14:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/2042/9/1/_/styles/combined.css?spaceKey=CXF20DOC&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://cwiki.apache.org/confluence/display/CXF20DOC/Server%2C+Service%2C+and+Client+FactoryBeans">Server,
Service, and Client FactoryBeans</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://cwiki.apache.org/confluence/display/~coheigea@apache.org">Colm
O hEigeartaigh</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" >CXF has four primary classes which
help in the representation of services: <br>||Class||Function|| <br></td></tr>
            <tr><td class="diff-changed-lines" >|Service|The Service contains
the service model, which is an abstract representation of the Service and <span class="diff-changed-words">it<span
class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">&#39;</span>s</span>
operations. It also contains information such as the databinding being used, the Invoker,
the Executor, service properties, interceptors, and more.| <br></td></tr>
            <tr><td class="diff-unchanged" >|Endpoint|The Endpoint represents
an endpoint which can receive messages. Its primary function is to hold Interceptors which
are specific to that endpoint (for instance, SOAP interceptors) and provide listeners for
faults that occur. Both the Client and Server use the Endpoint class.| <br>|Client|The
Client is a client implementation which manages message flows on the client side.| <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <h1><a name="Server%2CService%2CandClientFactoryBeans-Overview"></a>Overview</h1>
<p>CXF has four primary classes which help in the representation of services:</p>
<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'>Class</th>
<th class='confluenceTh'>Function</th>
</tr>
<tr>
<td class='confluenceTd'>Service</td>
<td class='confluenceTd'>The Service contains the service model, which is an abstract
representation of the Service and its operations. It also contains information such as the
databinding being used, the Invoker, the Executor, service properties, interceptors, and more.</td>
</tr>
<tr>
<td class='confluenceTd'>Endpoint</td>
<td class='confluenceTd'>The Endpoint represents an endpoint which can receive messages.
Its primary function is to hold Interceptors which are specific to that endpoint (for instance,
SOAP interceptors) and provide listeners for faults that occur. Both the Client and Server
use the Endpoint class.</td>
</tr>
<tr>
<td class='confluenceTd'>Client</td>
<td class='confluenceTd'>The Client is a client implementation which manages message
flows on the client side.</td>
</tr>
<tr>
<td class='confluenceTd'>Server</td>
<td class='confluenceTd'>The Server represents a Server endpoint inside CXF. It provides
hooks to start/stop the server and access the Endpoint.</td>
</tr>
</tbody></table>
</div>


<p>CXF also includes several factories to assist in the creation of clients and servers:</p>
<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'>Class</th>
<th class='confluenceTh'>Function</th>
<th class='confluenceTh'>Implementations</th>
</tr>
<tr>
<td class='confluenceTd'>AbstractServiceFactoryBean</td>
<td class='confluenceTd'>This class is responsible for creating the service model from
either a WSDL or a class file. It also sets up basic properties such as the databinding or
basic interceptors. It is most often hidden behind a Client/ServerFactoryBean.</td>
<td class='confluenceTd'>ReflectionServiceFactoryBean, JaxWsServiceFactoryBean</td>
</tr>
<tr>
<td class='confluenceTd'>ServerFactoryBean</td>
<td class='confluenceTd'>Creates a Server side endpoint.</td>
<td class='confluenceTd'>ServerFactoryBean, JaxWsServerFactoryBean</td>
</tr>
<tr>
<td class='confluenceTd'>ClientFactoryBean</td>
<td class='confluenceTd'>Creates a Client endpoint.</td>
<td class='confluenceTd'>ClientFactoryBean, JaxWsClientFactoryBean</td>
</tr>
<tr>
<td class='confluenceTd'>ClientProxyFactoryBean</td>
<td class='confluenceTd'>Creates a Java proxy around a Client</td>
<td class='confluenceTd'>ClientProxyFactoryBean, JaxWsProxyFactoryBean</td>
</tr>
</tbody></table>
</div>


<p>For more information on how to use these beans, please see the <a href="/confluence/display/CXF20DOC/Simple+Frontend"
title="Simple Frontend">Simple Frontend</a> page or the javadocs.</p>

<h1><a name="Server%2CService%2CandClientFactoryBeans-ServiceFactoryBeansandAbstractServiceConfiguration"></a>ServiceFactoryBeans
and AbstractServiceConfiguration</h1>
<p>The primary service factory bean inside CXF is the ReflectionServiceFactoryBean.
It provides a way to map a class to a service. If you are interested in controlling how this
mapping occurs, you can extend and provide your own Service configuration. Most configuration
of services happens through these. For instance, in the JAX-WS frontend, the JaxWsServiceConfiguration
controls how the service is mapped by inspecting the JAX-WS annotations.</p>

<p>To add your own service configuration:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
MyServiceConfiguration config = <span class="code-keyword">new</span> AbstractServiceConfiguration()
{
... <span class="code-comment">// your implementation
</span>};
ReflectionServiceFactoryBean serviceFactory = <span class="code-keyword">new</span>
ReflectionServiceFactoryBean();
serviceFactory.getServiceConfigurations().add(0, config);

ServerFactoryBean svrFactory = <span class="code-keyword">new</span> ServerFactoryBean();
svrFactory.setServiceFactory(serviceFactory);
...
Server svr = svrFactory.create();
</pre>
</div></div>
    </div>
        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;">
            <a href="https://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
        </div>
        <a href="https://cwiki.apache.org/confluence/display/CXF20DOC/Server%2C+Service%2C+and+Client+FactoryBeans">View
Online</a>
        |
        <a href="https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=49908&revisedVersion=5&originalVersion=4">View
Changes</a>
                |
        <a href="https://cwiki.apache.org/confluence/display/CXF20DOC/Server%2C+Service%2C+and+Client+FactoryBeans?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message