WEBSERVICE-CXF Introduction

Source: Internet
Author: User
Tags tomcat tomcat server wsdl

Baidu Encyclopedia


What is CXF Apache CXF = Celtix + Xfire supports multiple protocols: soap1.1,1,2 xml/http CORBA (Common object Request Broker Architecture common Object Solicitation broker architecture, early Language used by WS. c,c++,c#) • Fast and seamless integration with spring • Flexible deployment: Can be run on Tomcat,jboss,jetty (built-in), Ibmws,beawl above.

1. JAX-WS is a set of standards for developing webservice services released by Sun. Early standards such as JAX-RPC have rarely been used (nor is this tool attached to the current JDK), which is the standard used by axis. )。 And CXF is in the new standard JAX-WS developed under the WEBSERVICE,JAX-WS also built into the jdk1.6. (For Jax-RPC (Remoteprocess call) before 2006, do not go into it.)

2. For more information on JAX-WS specifications, please see the official documentation: Jax-ws.pdf in this catalogue.

3, on the integration with spring, will be explained later in the chapter. Finally, we deploy our service to the Tomcat server.

4, in the CXF before the many WebService framework such as: Axis,xfire interested students can go to know their own.




1, need to explain is: I downloaded the latest version of the CXF framework, which is based on jdk1.7 created, currently installed on our aircraft are jdk1.6.

Wait a minute. For client code generated using cxf2.4, make the appropriate adjustments


Bus

The bus is the support of the CXF framework. CXF bus consists of a spring configuration file (cxf.xml), when the servlet is initialized

Loaded by springbusfactory, it defines a common context for all endpoints. It weaves all the running

and provides a common application context. Springbusfactory Scanning and loading classpath

Under the META-INF/CXF directory and build the context from the following file.

Meta-inf/cxf/cxf.xml

Meta-inf/cxf/cxf-extension.xml

Meta-inf/cxf/cxf-property-editors.xml

The XML file is part of the installation of the CXF class library. CXF internal use spring to configure the. cxf.xml file in the bus definition as

Under

<bean id= "CXF" class= "Org.apache.cxf.bus.CXFBusImpl"/>

The core bus component is Cxfbusimpl, which more plays the role of the interceptor vendor for terminal access requests.

Once these interceptors are applied, they can be used for all terminals in the context. The Cxf.xml file also defines other groups

such as Bindingfactorymanager,conduitfactorymanager and so on. These components can be used for bus

Extensions. You can use the GetExtension () method for these components. Registering these components for obtaining or updating the service

Terminal-level parameters such as service bindings, transport protocols, relays, and so on.

--------------

frontend-Front End:

Frontend

CXF provides the concept of front-end modeling, which allows you to create WS using different front-end APIs. These APIs use a simple factory

The Bean and JAX-WS implementations create WS. You can create dynamic WS clients. The front-end support for CXF is primarily Jax-ws.

---------

Messageandintercetpors:

messages and interceptors

One of the important components of the CXF framework is the interceptor component. Interceptors intercept messages between the client and the server. In

CXF, this is achieved through the concept of the Interceptor chain. The Interceptor chain is the core function of the CXF runtime. Each intercept in the chain

The user can control the execution of the device.

The core of the framework is the Interceptor interface, which defines two methods Handlemessage and Handlefault, both carrying

With the message type as the parameter.

Interceptors are usually divided into stages. Each stage performs a specific message processing, and each stage is added to the interception

Chain, so that chains are sometimes ordered by the list of interceptor stages. A typical WS terminal has three connector chains:

Inbound messages chain (into the message chain)

Outbound messages Chain (out message chain)

Error messages Chain (bad message chain)

Built-in interceptors such as logs, security, or custom interceptors are also available.

-----

Service model- primarily used to generate WSDL the individual elements of the file.

Modeling service, creating various WSDL elements such as operations, bindings, terminals, schemas, and so on.

The individual components in the service model are shown as follows:

-------

Databinding

Data binding is the key to WS development. It implies a mapping between a Java object and an XML element. Data Binding Component

This work. CXF the latest version uses JAXB2.1.JAXB to define the mappings between Java objects and XML using annotations.

@XmlRootElement (name= "ProcessOrder",

Namespace= "Http://localhost/orderprocess")

@XmlAccessorType (Xmlaccesstype.field)

@XmlType (name= "ProcessOrder", namespace= "http://localhost/orderprocess")

public class Orderprocess {

@XmlElement (name= "arg0", namespace= "")

Privateorder. Order arg0;

Gettter and Setter

...

}

-----------

Protocol bindings: Protocol bindings

CXF supports the following forms of binding:

SOAP1.1

SOAP1.2

Corba

Pure XML

--

Data transfer--transport

CXF supports the following data transfer methods:

HTTP

Corba

Jms

LOCAL




additional support items for installing CXF:
Lant Ltomcat L and set the following environment variables: java_home cxf_home ant_home catalina_home Path =%java_home%\bin;%cxf_home%\bin;%catalina _home%\bin;%ant_home%\bin classpath=.; %cxf_home%\lib\cxf-manifest.jar;. \build\classes

1. Why use ant as a tool? Ant has been widely used as a tool and has a long history. Using Ant's Built-in commands, you can compile Java source files (javac), run Java files (Java), and package class files (Jar

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.