Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Use of Schemas and Namespaces

CXF uses XML schemas extensively in the runtime: Its core includes the JAXB mappings of standard schemas such as http://schemas.xmlsoap.org/wsdl/ and http://www.w3.org/2006/03/addressing/ws-addr.xsd. CXF also defines its own schemas for WSDL extensions such as the jms-address element in namespace http://cxf.apache.org/transports/jmsImage Removed, and schemas for both Spring and Blueprint (OSGi) configuration, for example the http://cxf.apache.org/jaxws and http://cxf.apache.org/blueprint/jaxwsImage Removed namespace namespaces.

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.

Spring uses a similar way to map systemIds to locations on the classpath (spring.schemas files), and that way validates your Spring configuration files. Validation can be disabled by setting system property Note if you're using Spring it will validate your Spring configuration files, using information in each JAR's META-INF/spring.schemas file (an example here). Validation is extremely helpful in diagnosing errors in CXF configurations, but it is also expensive at runtime. Once you have got your application working, you can disable validation by setting a system property: -Dorg.apache.spring.validation.mode to =VALIDATION_NONE), but the default is to have validation enabled. This is very useful when you are configuring CXF and not very familiar with CXF's configuration schemas or with Spring itself.What you need to know when writing a valid Spring configuration file is the system IDs for the schema file(s) defining the types that are using in the configuration file.

The table below contains includes the system IDs URIs for the CXF schema files configuration schemas that you may need to specify in your Spring configuration file, along with their target namespace.
file's schemaLocation attribute so that Spring's validating parser can validate the file. In theory you need not be concerned with the actual location of these files, as they should be available at their URI. In practice however, only the standard schemas are actually available that way, but CXF aims at publishing its schemas in the future. In the meantime, the files: Spring can normally detect their location from 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. You can also use the classpath location in the table below to find the schemas.the original version of the schema in the trunk.

Configuration Schemas common to both Spring and Blueprint

URI

System ID

Target Namespace

Classpath Resource

Module

{{

http://cxf.apache.org/schemas/configuration/http-conf.xsd

http://cxf.apache.org/transports/http/configuration

/schemas/configuration/http-conf.xsd

cxf-rt-transports-http

http://cxf.apache.org/schemas/configuration/http-jetty.xsd

http://cxf.apache.org/transports/http-jetty/configuration

/schemas/configuration/http-jetty.xsd

cxf-rt-transports-http-jetty

http://cxf.apache.org/schemas/configuration/jms.xsd

http://cxf.apache.org/transports/jms

/

schema

schemas/

bindings

configuration/

soap

jms.xsd

Image Removed}}

cxf-rt-transports-jms

http://cxf.apache.org/schemas/

bindings/soapImage Removed /org/apache/cxf/binding/soap/spring

configuration/security.xsd

http://cxf.apache.org/configuration/security

/schemas/configuration/security.xsd

cxf-core

http://cxf.apache.org/schemas/configuration/soap.xsd

http://cxf.apache.org/bindings/soap

/schemas/configuration/soap.xsd

cxf-rt-bindings-soap

http://cxf.apache.org/schemas/

configuration/cxf-beans.xsdImage Removed

ws-addr-conf.xsd

http://cxf.apache.org/ws/addressing

/schemas/ws-addr-conf.xsd

cxf-rt-ws-addr

http://cxf.apache.org/schemas/configuration

/beansImage Removed

/wsrm-manager-types.xsd

http://cxf.apache.org/ws/rm/manager

/schemas/configuration/

cxf

wsrm-manager-

beans

types.xsd

cxf-rt-

common

ws-

utilities

rm

http://cxf.apache.org/schemas/configuration/

http

wsrm-

conf

manager.xsd

Image Removed

http://cxf.apache.org/

transports

ws/

http

rm/

configurationImage Removed

manager

/schemas/configuration/

http

wsrm-

conf

manager.xsd

cxf-rt-

transports

ws-rm

http://cxf.apache.org/schemas/clustering.xsd

http://cxf.apache.org

/schemas/configuration/http-listener.xsdImage Removed

/clustering

/schemas/clustering.xsd

cxf-rt-features-clustering

* 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.

Spring-only Schemas

URI

Target Namespace

Classpath Resource

Module

http://cxf.apache.org/

transport

schemas/core.xsd

http

/listenerImage Removed

://cxf.apache.org/core

/schemas

/configuration/http-listener

/core.xsd

cxf-core

http://cxf.apache.org/schemas/jaxrs.xsd

http://cxf.apache.org/jaxrs

/schemas/jaxrs.xsd

cxf-rt-

transports

frontend-jaxrs

http://cxf.apache.org/schemas/jaxws.xsd

http://cxf.apache.org/jaxws

/schemas

/configuration/jms.xsdImage Removed

/jaxws.xsd

cxf-rt-frontend-jaxws

http://cxf.apache.org/schemas/policy.xsd

http://cxf.apache.org/policy

/

transports/jmsImage Removed /schemas/configuration/jms

schemas/policy.xsd

cxf-rt-ws-policy

http://cxf.apache.org/schemas/simple.xsd

http://cxf.apache.org/simple

/schemas/simple.xsd

cxf-rt-

transports-jms

frontend-simple

Blueprint-only Schemas

URI

Target Namespace

Classpath Resource

Module

http://cxf.apache.org/schemas/blueprint/core.xsd

http://cxf.apache.org/blueprint/core

/schemas/blueprint/core.xsd

cxf-core

http://cxf.apache.org/schemas/

configuration

blueprint/

security

jaxrs.xsd

Image Removed

http://cxf.apache.org/

configuration

blueprint/

securityImage Removed

jaxrs

/schemas/

configuration

blueprint/

security

jaxrs.xsd

cxf-

common

rt-frontend-

schemas

jaxrs

http://cxf.apache.org/schemas/blueprint/jaxws.xsd

Image Removed

http://cxf.apache.org/blueprint/jaxws

Image Removed

/schemas/blueprint/jaxws.xsd

cxf-rt-

frontends

frontend-jaxws

http://cxf.apache.org/schemas/blueprint/policy.xsd

http://cxf.apache.org/policy

/schemas/blueprint/policy.xsd

cxf-rt-ws

/addressing

-policy

http://cxf.apache.org/schemas/blueprint/simple.xsd

Image Removed

http://cxf.apache.org/

ws

blueprint/

addressingImage Removed

simple

/schemas/blueprint/simple.xsd

cxf-rt-frontend-simple

Example

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!

Code Block
xml
xml

<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"
    xmlns:jaxws="http://cxf.apache.org/jaxws"
    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">

    <http-conf:conduit name="{http://cxf.apache.org/hello_world_soap_http}SoapPort.http-conduit">
        <http-conf:client DecoupledEndpoint="http://localhost:9999/decoupled_endpoint"/>
    </http-conf:conduit>

    <jaxws:client name="{http://cxf.apache.org/hello_world_soap_http}SoapPort" createdFromAPI="true">
        <jaxws:conduitSelector>
            <bean class="org.apache.cxf.endpoint.DeferredConduitSelector"/>
        </jaxws:conduitSelector>
    </jaxws:client>
</beans>

Other Schemas

The following schemas are imported by one or more of 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.

URI

Target Namespace

Classpath Resource

Module

http://cxf.apache.org/schemas/configuration/cxf-beans.xsd

http://cxf.apache.org/configuration/beans

/schemas/configuration/cxf-beans.xsd

cxf-core

/ws-addr-conf.xsd cxf-rt-ws-addr

http://cxf.apache.org/schemas/wsdl/http-conf.xsd

Image Removed

http://cxf.apache.org/transports/http/configuration

Image Removed

/schemas/wsdl/http-conf.xsd

cxf-rt-transports-http

http://cxf.apache.org/schemas/wsdl/jms.xsd

Image Removed

http://cxf.apache.org/transports/jms

Image Removed

/schemas/wsdl/jms.xsd

cxf-rt-transports-jms

http://www.w3.org/2010/soapjms

http://www.w3.org/2010/soapjms

/schemas/wsdl/spec/jms-spec-wsdl.xsd

cxf

.apache.org/ws/rm/manager-types.xsdImage Removed http://cxf.apache.org/ws/rm/managerImage Removed

-rt-transports-jms

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

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

http://schemas.xmlsoap.org/ws/2004/08/addressing

http://schemas.xmlsoap.org/ws/2004/08/addressing

/schemas/wsdl/addressing.xsd

cxf-core

http://schemas.xmlsoap.org/ws/2004/09/policy/ws-policy.xsd

http://schemas.xmlsoap.org/ws/2004/09/policy

/schemas/ws-policy-200409

/schemas/configuration/manager-types

.xsd

cxf-rt-ws-rm

http://

cxf

schemas.

apache

xmlsoap.org/ws/2005/02/rm/

manager

wsrm-policy.xsd

Image Removed

http://

cxf

schemas.

apache

xmlsoap.org/ws/2005/02/rm/

managerImage Removed

policy

/schemas/configuration/

manager

wsrm-policy.xsd

cxf-rt-ws-rm

...

Note for Developers: If you define your own configuration schema, place it in the schemas subdirectory of the resources directory, then combine http://cxf.apache.org/Image Removed 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 spring.schemas file in your module's META-INF directory (note the escaped : character):

...