package org.spring.springboot.service.impl.cxf;
import org.spring.springboot.domain.cxf.User;
import org.spring.springboot.service.cxf.UserService;
import org.springframework.stereotype.Component;
import javax.activation.DataHandler;
import javax.activation.FileDataSource;
import javax.jws.WebService;
import java.io.*;
/**
* Created by Peng.lv on 2017/12/13.
*/
@WebService(serviceName = "UserService", // 与接口中指定的name一致
targetNamespace = "http://webservice.leftso.com/", // 与接口中的命名空间一致,一般是接口的包名倒
endpointInterface = "org.spring.springboot.service.cxf.UserService"// 接口地址
)
@Component
public class UserServiceImp implements UserService {
/**
* <修改用户信息,包括上传用户的图像
* 创 建 人: XX
* 创建时间: 2012-9-26 下午04:50:23
* @param user
* @see [类、类#方法、类#成员]
*/
@Override
public void updateUser(User user){
System.out.println("姓名:"+user.getName()+",年龄:"+user.getAge());
DataHandler handler = user.getImageData();
try {
InputStream is = handler.getInputStream();
OutputStream os = new FileOutputStream(new File("c:\\test11.jpg"));
byte[] b = new byte[100000];
int bytesRead = 0;
while ((bytesRead = is.read(b)) != -1) {
os.write(b, 0, bytesRead);
}
os.flush();
os.close();
is.close();
} catch (IOException e) {
e.printStackTrace();
}
}
/**
* 查询用户信息,包括以附件的形式返回用户的图像
* 创 建 人: XX
* 创建时间: 2012-9-26 下午04:49:43
* @return
* @see [类、类#方法、类#成员]
*/
@Override
public User getUser(){
User user =new User(11L,"李四",21);
user.setImageData(new DataHandler(new FileDataSource(new File("d:"+File.separator)+"test.jpg")));
System.out.println("处理完成,返回结果");
return user;
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
springboot cxf下载上传
共36个文件
java:14个
class:14个
xml:3个
需积分: 15 12 下载量 43 浏览量
2017-12-14
17:54:57
上传
评论
收藏 38KB ZIP 举报
温馨提示
springboot cxf下载上传springboot cxf下载上传springboot cxf下载上传springboot cxf下载上传springboot cxf下载上传springboot cxf下载上传springboot cxf下载上传springboot cxf下载上传springboot cxf下载上传springboot cxf下载上传springboot cxf下载上传
资源推荐
资源详情
资源评论
收起资源包目录
springboot-restful.zip (36个子文件)
springboot-restful
pom.xml 3KB
target
maven-status
maven-compiler-plugin
compile
default-compile
inputFiles.lst 2KB
createdFiles.lst 704B
classes
application.properties 377B
mapper
CityMapper.xml 2KB
org
spring
springboot
dao
CityDao.class 579B
config
ScheduleConfig.class 2KB
CxfConfig.class 2KB
domain
City.class 1KB
cxf
User.class 2KB
controller
CityRestController.class 2KB
service
CityService.class 487B
job
ScheduledTest.class 2KB
cxf
CommonService.class 589B
UserService.class 544B
impl
CityServiceImpl.class 1KB
cxf
CommonServiceImp.class 1KB
UserServiceImp.class 3KB
Application.class 796B
generated-sources
annotations
springboot-restful.iml 9KB
src
main
resources
application.properties 377B
mapper
CityMapper.xml 2KB
java
org
spring
springboot
dao
CityDao.java 621B
config
ScheduleConfig.java 2KB
CxfConfig.java 2KB
domain
City.java 1KB
cxf
User.java 2KB
Application.java 823B
controller
CityRestController.java 1KB
service
job
ScheduledTest.java 2KB
cxf
CommonService.java 704B
UserService.java 582B
CityService.java 861B
impl
CityServiceImpl.java 1014B
cxf
UserServiceImp.java 2KB
CommonServiceImp.java 864B
共 36 条
- 1
资源评论
yuanmenghaixin
- 粉丝: 1
- 资源: 6
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功