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 > Schemas and Namespaces
Date Wed, 02 Mar 2011 13:14:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/2036/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/Schemas+and+Namespaces">Schemas
and Namespaces</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://cwiki.apache.org/confluence/display/~njiang">willem
jiang</a>
    </h4>
        <div id="versionComment">
        <b>Comment:</b>
        CXF-3368 <br />
    </div>
        <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" >| [http://cxf.apache.org/schemas/wsdl/http-conf.xsd]
| [http://cxf.apache.org/transports/http/configuration] | /schemas/wsdl/http-conf.xsd | cxf-rt-transports-http
| <br>| [http://cxf.apache.org/schemas/wsdl/jms.xsd] | [http://cxf.apache.org/transports/jms]
| /schemas/wsdl/jms.xsd | cxf-rt-transports-jms | <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">|
[http://www.w3.org/2010/soapjms] |[http://www.w3.org/2010/soapjms]| /schemas/wsdl/spec/jms-spec-wsdl.xsd
| cxf-rt-transports-jms | <br></td></tr>
            <tr><td class="diff-unchanged" >| [http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd]
| [http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd] | /schemas/oasis-200401-wss-wssecurity-secext-1.0.xsd
| cxf-rt-ws-policy | <br>| [http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd]
| [http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd] | /schemas/oasis-200401-wss-wssecurity-utility-1.0.xsd
| cxf-rt-ws-policy | <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <h1><a name="SchemasandNamespaces-UseofSchemasandNamespaces"></a>Use
of Schemas and Namespaces</h1>

<p>CXF uses XML schemas extensively in the runtime: Its core includes the JAXB mappings
of standard schemas such as <a href="http://schemas.xmlsoap.org/wsdl/" class="external-link"
rel="nofollow">http://schemas.xmlsoap.org/wsdl/</a> and <a href="http://www.w3.org/2006/03/addressing/ws-addr.xsd"
class="external-link" rel="nofollow">http://www.w3.org/2006/03/addressing/ws-addr.xsd</a>.
CXF also defines its own schemas for WSDL extensions such as the jms-address element in namespace
<a href="http://cxf.apache.org/transports/jms" class="external-link" rel="nofollow">http://cxf.apache.org/transports/jms</a>,
and schemas for Spring configuration, for example the <a href="http://cxf.apache.org/jaxws"
class="external-link" rel="nofollow">http://cxf.apache.org/jaxws</a> namespace.</p>

<p>To avoid accessing resources over the network during a build, CXF maintains local
copies of these schemas. Logically however, third party as well as CXF schemas, are as well
as the CXF schemas, are referred to by their public URIs in schemaLocation attributes and
similar places. The CXF code generators use catalog files to map them to their actual location
in the trunk, see the pom.xml file in the api module for an example.</p>

<p>Spring uses a similar way to map URIs to locations on the classpath (spring.schemas
files), and that way validates your Spring configuration files. Validation is extremely helpful
in diagnosing errors in CXF configurations, but it is also very expensive at runtime. Once
you have got your application working, you can disable validation by setting a system property:
<tt>org.apache.cxf.spring.validation.mode</tt> (in 2.1) or <tt>spring.validation.mode</tt>
(in 2.0.x). Set it as follows to disable validation:</p>

<p><tt>&#45;Dorg.apache.spring.validation.mode=VALIDATION_NONE</tt></p>

<p>The table below lists the URIs for the CXF configuration schemas that you need to
specify in your Spring configuration file's schemaLocation attribute so that Spring's validating
parse can validate the file.<br/>
In theory you need not be concerned with the actual location of the files: Spring knows about
their location on the classpath. And if you want to check the content of a schema file (in
a binary distribution), you should be able to do so using its URI. At the moment this is not
possible, however CXF aims at publishing its schemas in the future. In the meantime, you can
use the classpath location in the table below to find the original version of the schema in
the trunk.</p>

<p><b>Configuration Schemas</b></p>
<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> URI </th>
<th class='confluenceTh'> Target Namespace </th>
<th class='confluenceTh'> Classpath Resource </th>
<th class='confluenceTh'> Module </th>
</tr>
<tr>
<td class='confluenceTd'> <a href="http://cxf.apache.org/schemas/core.xsd" class="external-link"
rel="nofollow">http://cxf.apache.org/schemas/core.xsd</a> </td>
<td class='confluenceTd'> <a href="http://cxf.apache.org/core" class="external-link"
rel="nofollow">http://cxf.apache.org/core</a> </td>
<td class='confluenceTd'> /schemas/core.xsd </td>
<td class='confluenceTd'> cxf-rt-core </td>
</tr>
<tr>
<td class='confluenceTd'> <a href="http://cxf.apache.org/schemas/configuration/http-conf.xsd"
class="external-link" rel="nofollow">http://cxf.apache.org/schemas/configuration/http-conf.xsd</a>
</td>
<td class='confluenceTd'> <a href="http://cxf.apache.org/transports/http/configuration"
class="external-link" rel="nofollow">http://cxf.apache.org/transports/http/configuration</a>
</td>
<td class='confluenceTd'> /schemas/configuration/http-conf.xsd </td>
<td class='confluenceTd'> cxf-rt-transports-http </td>
</tr>
<tr>
<td class='confluenceTd'> <a href="http://cxf.apache.org/schemas/configuration/http-jetty.xsd"
class="external-link" rel="nofollow">http://cxf.apache.org/schemas/configuration/http-jetty.xsd</a>
</td>
<td class='confluenceTd'> <a href="http://cxf.apache.org/transport/http-jetty/configuration"
class="external-link" rel="nofollow">http://cxf.apache.org/transport/http-jetty/configuration</a>
</td>
<td class='confluenceTd'> /schemas/configuration/http-jetty.xsd </td>
<td class='confluenceTd'> cxf-rt-transports-http-jetty </td>
</tr>
<tr>
<td class='confluenceTd'> <a href="http://cxf.apache.org/schemas/configuration/jms.xsd"
class="external-link" rel="nofollow">http://cxf.apache.org/schemas/configuration/jms.xsd</a>
</td>
<td class='confluenceTd'> <a href="http://cxf.apache.org/transports/jms" class="external-link"
rel="nofollow">http://cxf.apache.org/transports/jms</a> </td>
<td class='confluenceTd'> /schemas/configuration/jms.xsd </td>
<td class='confluenceTd'> cxf-rt-transports-jms </td>
</tr>
<tr>
<td class='confluenceTd'> <a href="http://cxf.apache.org/schemas/configuration/security.xsd"
class="external-link" rel="nofollow">http://cxf.apache.org/schemas/configuration/security.xsd</a>
</td>
<td class='confluenceTd'> <a href="http://cxf.apache.org/configuration/security"
class="external-link" rel="nofollow">http://cxf.apache.org/configuration/security</a>
</td>
<td class='confluenceTd'> /schemas/configuration/security.xsd </td>
<td class='confluenceTd'> cxf-common-schemas </td>
</tr>
<tr>
<td class='confluenceTd'> <a href="http://cxf.apache.org/schemas/configuration/soap.xsd"
class="external-link" rel="nofollow">http://cxf.apache.org/schemas/configuration/soap.xsd</a>
</td>
<td class='confluenceTd'> <a href="http://cxf.apache.org/bindings/soap" class="external-link"
rel="nofollow">http://cxf.apache.org/bindings/soap</a> </td>
<td class='confluenceTd'> /schemas/configuration/soap.xsd </td>
<td class='confluenceTd'> cxf-rt-bindings-soap </td>
</tr>
<tr>
<td class='confluenceTd'> <a href="http://cxf.apache.org/schemas/jaxws.xsd" class="external-link"
rel="nofollow">http://cxf.apache.org/schemas/jaxws.xsd</a> </td>
<td class='confluenceTd'> <a href="http://cxf.apache.org/jaxws" class="external-link"
rel="nofollow">http://cxf.apache.org/jaxws</a> </td>
<td class='confluenceTd'> /schemas/jaxws.xsd </td>
<td class='confluenceTd'> cxf-rt-frontend-jaxws </td>
</tr>
<tr>
<td class='confluenceTd'> <a href="http://cxf.apache.org/schemas/simple.xsd" class="external-link"
rel="nofollow">http://cxf.apache.org/schemas/simple.xsd</a> </td>
<td class='confluenceTd'> <a href="http://cxf.apache.org/simple" class="external-link"
rel="nofollow">http://cxf.apache.org/simple</a> </td>
<td class='confluenceTd'> /schemas/simple.xsd </td>
<td class='confluenceTd'> cxf-rt-frontend-simple </td>
</tr>
<tr>
<td class='confluenceTd'> <a href="http://cxf.apache.org/schemas/ws-addr-conf.xsd"
class="external-link" rel="nofollow">http://cxf.apache.org/schemas/ws-addr-conf.xsd</a>
</td>
<td class='confluenceTd'> <a href="http://cxf.apache.org/ws/addressing" class="external-link"
rel="nofollow">http://cxf.apache.org/ws/addressing</a> </td>
<td class='confluenceTd'> /schemas/ws-addr-conf.xsd </td>
<td class='confluenceTd'> cxf-rt-ws-addr </td>
</tr>
<tr>
<td class='confluenceTd'> <a href="http://cxf.apache.org/schemas/configuration/wsrm-manager-types.xsd"
class="external-link" rel="nofollow">http://cxf.apache.org/schemas/configuration/wsrm-manager-types.xsd</a>
</td>
<td class='confluenceTd'> <a href="http://cxf.apache.org/ws/rm/manager" class="external-link"
rel="nofollow">http://cxf.apache.org/ws/rm/manager</a> </td>
<td class='confluenceTd'> /schemas/configuration/wsrm-manager-types.xsd </td>
<td class='confluenceTd'> cxf-rt-ws-rm </td>
</tr>
<tr>
<td class='confluenceTd'> <a href="http://cxf.apache.org/schemas/configuration/wsrm-manager.xsd"
class="external-link" rel="nofollow">http://cxf.apache.org/schemas/configuration/wsrm-manager.xsd</a>
</td>
<td class='confluenceTd'> <a href="http://cxf.apache.org/ws/rm/manager" class="external-link"
rel="nofollow">http://cxf.apache.org/ws/rm/manager</a> </td>
<td class='confluenceTd'> /schemas/configuration/wsrm-manager.xsd &#42; </td>
<td class='confluenceTd'> cxf-rt-ws-rm </td>
</tr>
</tbody></table>
</div>


<p>&#42; wsrm-manager.xsd does an  "xsd:include" on wsrm-manager-types.xsd as they
are in the same namespace. As such, the user just needs to reference wsrm-manager.xsd to use
both.</p>

<p><b>Example</b></p>

<p>The following is an example of a valid Spring configuration file. Using the table
above, there is no magic involved in setting the correct value for the schemaLocation attribute&#33;</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml">
&lt;beans xmlns=<span class="code-quote">"http://www.springframework.org/schema/beans"</span>
    <span class="code-keyword">xmlns:xsi</span>=<span class="code-quote">"http://www.w3.org/2001/XMLSchema-instance"</span>
    <span class="code-keyword">xmlns:http-conf</span>=<span class="code-quote">"http://cxf.apache.org/transports/http/configuration"</span>
    <span class="code-keyword">xmlns:jaxws</span>=<span class="code-quote">"http://cxf.apache.org/jaxws"</span>
    xsi:schemaLocation="
http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"&gt;

    <span class="code-tag">&lt;http-conf:conduit name=<span class="code-quote">"{http://cxf.apache.org/hello_world_soap_http}SoapPort.http-conduit"</span>&gt;</span>
        <span class="code-tag">&lt;http-conf:client DecoupledEndpoint=<span class="code-quote">"http://localhost:9999/decoupled_endpoint"</span>/&gt;</span>
    <span class="code-tag">&lt;/http-conf:conduit&gt;</span>

    <span class="code-tag">&lt;jaxws:client name=<span class="code-quote">"{http://cxf.apache.org/hello_world_soap_http}SoapPort"</span>
createdFromAPI=<span class="code-quote">"true"</span>&gt;</span>
        <span class="code-tag">&lt;jaxws:conduitSelector&gt;</span>
            <span class="code-tag">&lt;bean class=<span class="code-quote">"org.apache.cxf.endpoint.DeferredConduitSelector"</span>/&gt;</span>
        <span class="code-tag">&lt;/jaxws:conduitSelector&gt;</span>
    <span class="code-tag">&lt;/jaxws:client&gt;</span>
</pre>
</div></div>
<p><b>Other Schemas</b></p>

<p>The following schemas are imported by the schemas above, directly or indirectly.
You may also find their classpath locations useful when you import or include any of the schemas
below in your own schema, and want to know hpw you can access them locally (actually, it'd
be cool if someone wrote a CatalogResolver based on the URI - classpath location mappings
that already exist and get the CXF tools and/or xjc to use it).</p>
<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> URI </th>
<th class='confluenceTh'> Target Namespace </th>
<th class='confluenceTh'> Classpath Resource </th>
<th class='confluenceTh'> Module </th>
</tr>
<tr>
<td class='confluenceTd'> <a href="http://cxf.apache.org/schemas/configuration/cxf-beans.xsd"
class="external-link" rel="nofollow">http://cxf.apache.org/schemas/configuration/cxf-beans.xsd</a>
</td>
<td class='confluenceTd'> <a href="http://cxf.apache.org/configuration/beans" class="external-link"
rel="nofollow">http://cxf.apache.org/configuration/beans</a> </td>
<td class='confluenceTd'> /schemas/configuration/cxf-beans.xsd </td>
<td class='confluenceTd'> cxf-common-utilities </td>
</tr>
<tr>
<td class='confluenceTd'> <a href="http://cxf.apache.org/schemas/wsdl/http-conf.xsd"
class="external-link" rel="nofollow">http://cxf.apache.org/schemas/wsdl/http-conf.xsd</a>
</td>
<td class='confluenceTd'> <a href="http://cxf.apache.org/transports/http/configuration"
class="external-link" rel="nofollow">http://cxf.apache.org/transports/http/configuration</a>
</td>
<td class='confluenceTd'> /schemas/wsdl/http-conf.xsd </td>
<td class='confluenceTd'> cxf-rt-transports-http </td>
</tr>
<tr>
<td class='confluenceTd'> <a href="http://cxf.apache.org/schemas/wsdl/jms.xsd" class="external-link"
rel="nofollow">http://cxf.apache.org/schemas/wsdl/jms.xsd</a> </td>
<td class='confluenceTd'> <a href="http://cxf.apache.org/transports/jms" class="external-link"
rel="nofollow">http://cxf.apache.org/transports/jms</a> </td>
<td class='confluenceTd'> /schemas/wsdl/jms.xsd </td>
<td class='confluenceTd'> cxf-rt-transports-jms </td>
</tr>
<tr>
<td class='confluenceTd'> <a href="http://www.w3.org/2010/soapjms" class="external-link"
rel="nofollow">http://www.w3.org/2010/soapjms</a> </td>
<td class='confluenceTd'><a href="http://www.w3.org/2010/soapjms" class="external-link"
rel="nofollow">http://www.w3.org/2010/soapjms</a></td>
<td class='confluenceTd'> /schemas/wsdl/spec/jms-spec-wsdl.xsd </td>
<td class='confluenceTd'> cxf-rt-transports-jms </td>
</tr>
<tr>
<td class='confluenceTd'> <a href="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
class="external-link" rel="nofollow">http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd</a>
</td>
<td class='confluenceTd'> <a href="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
class="external-link" rel="nofollow">http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd</a>
</td>
<td class='confluenceTd'> /schemas/oasis-200401-wss-wssecurity-secext-1.0.xsd </td>
<td class='confluenceTd'> cxf-rt-ws-policy </td>
</tr>
<tr>
<td class='confluenceTd'> <a href="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
class="external-link" rel="nofollow">http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd</a>
</td>
<td class='confluenceTd'> <a href="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
class="external-link" rel="nofollow">http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd</a>
</td>
<td class='confluenceTd'> /schemas/oasis-200401-wss-wssecurity-utility-1.0.xsd </td>
<td class='confluenceTd'> cxf-rt-ws-policy </td>
</tr>
<tr>
<td class='confluenceTd'> <a href="http://schemas.xmlsoap.org/ws/2004/08/addressing"
class="external-link" rel="nofollow">http://schemas.xmlsoap.org/ws/2004/08/addressing</a>
</td>
<td class='confluenceTd'> <a href="http://schemas.xmlsoap.org/ws/2004/08/addressing"
class="external-link" rel="nofollow">http://schemas.xmlsoap.org/ws/2004/08/addressing</a>
</td>
<td class='confluenceTd'> /schemas/wsdl/addressing.xsd </td>
<td class='confluenceTd'> cxf-common-schemas </td>
</tr>
<tr>
<td class='confluenceTd'> <a href="http://schemas.xmlsoap.org/ws/2004/09/policy/ws-policy.xsd"
class="external-link" rel="nofollow">http://schemas.xmlsoap.org/ws/2004/09/policy/ws-policy.xsd</a>
</td>
<td class='confluenceTd'> <a href="http://schemas.xmlsoap.org/ws/2004/09/policy"
class="external-link" rel="nofollow">http://schemas.xmlsoap.org/ws/2004/09/policy</a>
</td>
<td class='confluenceTd'> /schemas/ws-policy-200409.xsd </td>
<td class='confluenceTd'> cxf-rt-ws-rm </td>
</tr>
<tr>
<td class='confluenceTd'> <a href="http://schemas.xmlsoap.org/ws/2005/02/rm/wsrm-policy.xsd"
class="external-link" rel="nofollow">http://schemas.xmlsoap.org/ws/2005/02/rm/wsrm-policy.xsd</a>
</td>
<td class='confluenceTd'> <a href="http://schemas.xmlsoap.org/ws/2005/02/rm/policy"
class="external-link" rel="nofollow">http://schemas.xmlsoap.org/ws/2005/02/rm/policy</a>
</td>
<td class='confluenceTd'> /schemas/configuration/wsrm-policy.xsd </td>
<td class='confluenceTd'> cxf-rt-ws-rm </td>
</tr>
<tr>
<td class='confluenceTd'> <a href="http://schemas.xmlsoap.org/wsdl/" class="external-link"
rel="nofollow">http://schemas.xmlsoap.org/wsdl/</a> </td>
<td class='confluenceTd'> <a href="http://schemas.xmlsoap.org/wsdl/" class="external-link"
rel="nofollow">http://schemas.xmlsoap.org/wsdl/</a> </td>
<td class='confluenceTd'> /schemas/wsdl/wsdl.xsd </td>
<td class='confluenceTd'> cxf-common-schemas </td>
</tr>
<tr>
<td class='confluenceTd'> <a href="http://schemas.xmlsoap.org/wsdl/http/" class="external-link"
rel="nofollow">http://schemas.xmlsoap.org/wsdl/http/</a> </td>
<td class='confluenceTd'> <a href="http://schemas.xmlsoap.org/wsdl/http/" class="external-link"
rel="nofollow">http://schemas.xmlsoap.org/wsdl/http/</a> </td>
<td class='confluenceTd'> /schemas/wsdl/http.xsd </td>
<td class='confluenceTd'> cxf-common-schemas </td>
</tr>
<tr>
<td class='confluenceTd'> <a href="http://www.w3.org/2001/xml.xsd" class="external-link"
rel="nofollow">http://www.w3.org/2001/xml.xsd</a> </td>
<td class='confluenceTd'> <a href="http://www.w3.org/XML/1998/namespace" class="external-link"
rel="nofollow">http://www.w3.org/XML/1998/namespace</a> </td>
<td class='confluenceTd'> /schemas/xml.xsd </td>
<td class='confluenceTd'> cxf-rt-ws-policy </td>
</tr>
<tr>
<td class='confluenceTd'> <a href="http://www.w3.org/2006/07/ws-policy.xsd" class="external-link"
rel="nofollow">http://www.w3.org/2006/07/ws-policy.xsd</a> </td>
<td class='confluenceTd'> <a href="http://www.w3.org/2006/07/ws-policy" class="external-link"
rel="nofollow">http://www.w3.org/2006/07/ws-policy</a> </td>
<td class='confluenceTd'> /schemas/ws-policy-200607.xsd </td>
<td class='confluenceTd'> cxf-rt-ws-policy </td>
</tr>
</tbody></table>
</div>

<p>Note for Developers: If you define your own configuration schema, place it in the
schemas subdirectory of the resources directory, then combine <a href="http://cxf.apache.org/"
class="external-link" rel="nofollow">http://cxf.apache.org/</a> and the path of the
schema relative to the resources directory to form the system ID, and make the latter known
to Spring by adding a line similar to the following to the <b>spring.schemas</b>
file in your module's META-INF directory (note the escaped : character):</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml">
http\://cxf.apache.org/schemas/wsdl/http-conf.xsd=schemas/wsdl/http-conf.xsd
</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/Schemas+and+Namespaces">View
Online</a>
        |
        <a href="https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=56013&revisedVersion=25&originalVersion=24">View
Changes</a>
                |
        <a href="https://cwiki.apache.org/confluence/display/CXF20DOC/Schemas+and+Namespaces?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message