WebService

Web service是一个平台独立的,低耦合的,自包含的、基于可编程的web的应用程序,可使用开放的XML(标准通用标记语言下的一个子集)标准来描述、发布、发现、协调和配置这些应用程序,用于开发分布式的互操作的应用程序。

Web Service技术, 能使得运行在不同机器上的不同应用无须借助附加的、专门的第三方软件或硬件, 就可相互交换数据或集成。依据Web Service规范实施的应用之间, 无论它们所使用的语言、 平台或内部协议是什么, 都可以相互交换数据。Web Service是自描述、 自包含的可用网络模块, 可以执行具体的业务功能。Web Service也很容易部署, 因为它们基于一些常规的产业标准以及已有的一些技术,诸如标准通用标记语言下的子集XMLHTTPWeb Service减少了应用接口的花费。Web Service为整个企业甚至多个组织之间的业务流程的集成提供了一个通用机制。

CXF——WebService简介,CXF框架的使用

WebService的特点

  • WebService通过HTTP POST方式接受客户的请求
  • WebService与客户端之间一般使用SOAP协议传输XML数据
  • 它本身就是为了跨平台或跨语言而设计的

使用apache CXF发布一个WebService

1、创建数据库并建表

 1 /*
 2 Navicat MySQL Data Transfer
 3 
 4 Source Server         : root
 5 Source Server Version : 50022
 6 Source Host           : localhost:3306
 7 Source Database       : crm
 8 
 9 Target Server Type    : MYSQL
10 Target Server Version : 50022
11 File Encoding         : 65001
12 
13 Date: 2015-04-19 17:46:45
14 */
15 
16 SET FOREIGN_KEY_CHECKS=0;
17 
18 -- ----------------------------
19 -- Table structure for `t_customer`
20 -- ----------------------------
21 DROP TABLE IF EXISTS `t_customer`;
22 CREATE TABLE `t_customer` (
23   `id` int(11) NOT NULL auto_increment,
24   `name` varchar(255) default NULL,
25   `station` varchar(255) default NULL,
26   `telephone` varchar(255) default NULL,
27   `address` varchar(255) default NULL,
28   `decidedzone_id` varchar(255) default NULL,
29   PRIMARY KEY  (`id`)
30 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
31 
32 -- ----------------------------
33 -- Records of t_customer
34 -- ----------------------------
35 INSERT INTO `t_customer` VALUES ('1', '张三', '百度', '13811111111', '北京市西城区长安街100号', null);
36 INSERT INTO `t_customer` VALUES ('2', '李四', '哇哈哈', '13822222222', '上海市虹桥区南京路250号', null);
37 INSERT INTO `t_customer` VALUES ('3', '王五', '搜狗', '13533333333', '天津市河北区中山路30号', null);
38 INSERT INTO `t_customer` VALUES ('4', '赵六', '联想', '18633333333', '石家庄市桥西区和平路10号', null);
39 INSERT INTO `t_customer` VALUES ('5', '小白', '测试空间', '18511111111', '内蒙古自治区呼和浩特市和平路100号', null);
40 INSERT INTO `t_customer` VALUES ('6', '小黑', '联想', '13722222222', '天津市南开区红旗路20号', null);
41 INSERT INTO `t_customer` VALUES ('7', '小花', '百度', '13733333333', '北京市东城区王府井大街20号', null);
42 INSERT INTO `t_customer` VALUES ('8', '小李', '长城', '13788888888', '北京市昌平区建材城西路100号', null);
建表语句

相关文章:

  • 2021-08-03
  • 2021-10-16
  • 2021-08-03
  • 2022-12-23
  • 2021-08-03
  • 2022-12-23
  • 2021-11-09
  • 2022-12-23
猜你喜欢
  • 2021-05-02
  • 2022-12-23
  • 2021-05-28
  • 2021-04-10
  • 2021-09-05
  • 2022-12-23
相关资源
相似解决方案