java rest版简单的webservice
目前的webservice风格,rest应该是其中一种 还有种就是soap,rest是轻量级的,越来越流行。下面举一个简单例子说明下rest的用法。
1. 准备ws的jar和spring的jar,如何要连接数据的话就自行准备这边就不提供了
下载jar地址:http://download.csdn.net/detail/taopeng_100/7827035
或者:http://pan.baidu.com/s/1qWVejtq
下载好jar之后将其放入lib下就可以了。
1. 创建个项目,名叫RestwsTest,配置spring配置文件spring-source.xml
spring-source.xml如下:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://cxf.apache.org/aop" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:jaxws="http://cxf.apache.org/jaxws" xmlns:jaxrs="http://cxf.apache.org/jaxrs"
xmlns:jee="http://www.springframework.org/schema/jee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/jee
http://www.springframework.org/schema/jee/spring-jee-3.2.xsd
http://cxf.apache.org/jaxws
http://cxf.apache.org/schemas/jaxws.xsd
http://cxf.apache.org/jaxrs
http://cxf.apache.org/schemas/jaxrs.xsd">
<context:annotation-config />
<context:component-scan base-package="com.*" />
<import resource="classpath:META-INF/cxf/cxf.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
<bean id="restSample" class="com.hoo.service.RESTSampleSource" />
<jaxrs:server id="restServiceContainer" address="/rest">
<jaxrs:serviceBeans>
<bean class="com.tp.soft.web.ws.impl.LoginServiceImpl" />
</jaxrs:serviceBeans>
<jaxrs:extensionMappings>
<entry key="json" value="application/json" />
<entry key="" value="application/" />
</jaxrs:extensionMappings>
<jaxrs:languageMappings>
<entry key="en" value="en-gb"></entry>
</jaxrs:languageMappings>
<jaxrs:providers>
<bean class="org.codehaus.jackson.jaxrs.JacksonJsonProvider" />
</jaxrs:providers>
</jaxrs:server>
</beans>
2. 配置web.xml文件
web.xml内容如下:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
id="WebApp_ID" version="3.0">
<display-name>RestwsTest</display-name>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring-source.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>CXFServlet</servlet-name>
<servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
<load-on-startup>0</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>CXFServlet</servlet-name>
<url-pattern>/ws/*</url-pattern>
</servlet-mapping>
</web-app>
3. 编写接口LoginService
LoginService.java如下:
package com.tp.soft.web.ws; import java.util.Map;
import javax.jws.WebService; @WebService
public interface LoginService {
public abstract Map<String, Object> doLogin(String username, String password);
}
4. 编写接口的实现类LoginServiceImpl
LoginServiceImpl.java如下:
package com.tp.soft.web.ws.impl; import java.util.HashMap;
import java.util.Map; import javax.ws.rs.FormParam;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType; import com.tp.soft.web.ws.LoginService; @Path("/loginService")
public class LoginServiceImpl implements LoginService {
@POST
@Path(value = "/login")
@Produces(MediaType.APPLICATION_JSON)
public Map<String, Object> doLogin(
@FormParam(value = "username") String username,
@FormParam(value = "password") String password) {
Map<String, Object> map = new HashMap<String, Object>();
map.put("user", username + password);
return map;
}
}
此时可以在本地直接通过浏览器访问地址:http://localhost:8080/RestwsTest/ws/rest/loginService /login?username="zs"&password="123"
特别注意这边访问的是通过get的 如果要能访问就要将@POST改成@GET
4. 服务器写好了,下面就来写客服端的代码,客户端主要就是获取user对象的json,代码如下:
RestClient.java如下:
package com.tp.soft.client; import java.io.IOException;
import java.util.Map;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpException;
import org.apache.commons.httpclient.NameValuePair;
import org.apache.commons.httpclient.methods.PostMethod; public class RestClient {
public static void main(String[] args) {
String url = "http://localhost:8080/RestwsTest/ws/rest/loginService/login";
HttpClient client = new HttpClient();
PostMethod method = new PostMethod(url);
NameValuePair[] data = { new NameValuePair("username", "zs"),
new NameValuePair("password", "123") };
method.setRequestBody(data);
try {
int statusCode = client.executeMethod(method);
if (statusCode == 200) {
String strJson = method.getResponseBodyAsString();
System.out.println(strJson);
// System.out.println(map.get("user").getUsername());
}
} catch (HttpException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}
注意上面代码里面的PostMethod,在LoginServiceImpl里面的方法必须是@POST才可以,如果是@GET或者其他会报错的。
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAA7AAAACKCAIAAAAc1jHDAAAgAElEQVR4nO2db8wlV13Hb4LGGDG+MSa+8o0JdteEF8KL54qiARsxWsQ/XWgrpdAMtEAr9F9qkIokbKvAc6VIayAUFIlCa9WUcYXNBpvKhrhkxSxFvG9owpPQ2gV2K9ul22R8MffOPXPO7/zOmTkz98698/nkl3afO3P+/c6/7zlz7tzJ957+ZmnHTh4cO3nw5HcvYaUVRZEfP5UfP1WASumljdcXhmEYhmFYO5tUaviJp36AVVbqvE1LzW0iP35q47WGYRiGYRjWwialGv7GwbOYaajhFuTHT2284jAMwzAMw5raQhB/9Zvfxyor2B5uRX781MbrDsMwDMMwrKlNjp08+PL/PIO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Gb5Z4tY/+JW/sk8eqODe0QS+8hnjgi2FMi8Vz08hb50PTyqp1uu5IjiAEAAAAk+hXEMCCoQwAAAAAJBPFY2Pir6gAAAACGSaQg5g0F2w56GAAAAEAmUhAX0tfiYCtYnk9mPQMAAAAgES+IAQAAAAB2EAQxAAAAAIwaBDEAAAAAjBoEMQAAAACMGgQxAAAAAIwaBDEAAAAAjBoEMQAAAACMGgQxAAAAAIwaBDEAAAAAjBoEMQAAAACMGgQxAAAAAIwaBDEAAAAAjBoEMQAAAACMGgQxAAAAAIwaBDEAAAAAjBoEMQAAAACMGgQxAAAAAIwaBDEAAAAAjBoEMQAAAACMGgQxAAAAAIwaBDEAAAAAjBoEMQAAAACMGgQxAAAAAIwaBDEAAAAAjJr/B7e+yVxIgWmMAAAAAElFTkSuQmCC" alt="" />
java rest版简单的webservice的更多相关文章
- JAX-WS 学习一:基于java的最简单的WebService服务
JAVA 1.6 之后,自带的JAX-WS API,这使得我们可以很方便的开发一个基于Java的WebService服务. 基于JAVA的WebService 服务 1.创建服务端WebService ...
- Java完成最简单的WebService创建及使用(REST方式,Jersey框架)
前言: 一直以来都对WebService感兴趣,但因为难以理解WebService到底是什么,所以了解甚少.周二的时候有个跟我关系比较好的同事想要自己写个WebService的小Demo,希望能够做成 ...
- Java发布一个简单 webservice应用 并发送SOAP请求
一.创建并发布一个简单的webservice应用 1.webservice 代码: package com.ls.demo; import javax.jws.WebMethod; import ja ...
- 利用Java编写简单的WebService实例
使用Axis编写WebService比較简单,就我的理解,WebService的实现代码和编写Java代码事实上没有什么差别,主要是将哪些Java类公布为WebService. 以下是一个从编写測试样 ...
- 利用Java编写简单的WebService实例-转载
使用Axis编写WebService比较简单,就我的理解,WebService的实现代码和编写Java代码其实没有什么区别,主要是将哪些Java类发布为WebService.下面是一个从编写测试例子到 ...
- eclipse安装Axis2插件和简单的webservice发布
2019独角兽企业重金招聘Python工程师标准>>> Axis2与CXF是现在很主流的WebService开发框架(java6也已经支持了),项目上还都是基本上用前两种做开发,今天 ...
- Spring Security4实例(Java config 版) —— Remember-Me
本文源码请看这里 相关文章: Spring Security4实例(Java config版)--ajax登录,自定义验证 Spring Security提供了两种remember-me的实现,一种是 ...
- 使用Axis2创建一个简单的WebService服务
使用过Java进行过WebService开发都会听过或者接触过Apache Axis2,Axis2框架是应用最广泛的WebService框架之一了. 这里使用Axis2来开发和部署一个最简单的WebS ...
- java入门---简介&简单输出小例子&开发前准备
Java是由Sun Microsystems公司于1995年5月推出的Java面向对象程序设计语言和Java平台的总称.由James Gosling和同事们共同研发,并在1995年正式推出.J ...
随机推荐
- apache kafka技术分享系列(目录索引)--转载
原文地址:http://blog.csdn.net/lizhitao/article/details/39499283 kafka开发与管理: 1)apache kafka消息服务 2)kafak安装 ...
- SonarQube代码质量管理平台安装与使用--转载
原文:http://blog.csdn.net/hunterno4/article/details/11687269 Sonar简介 Sonar是一个用于代码质量管理的开源平台,用于管理源代码的质量, ...
- Android 自定义View修炼-自定义HorizontalScrollView视图实现仿ViewPager效果
开发过程中,需要达到 HorizontalScrollView和ViewPager的效果,于是直接重写了HorizontalScrollView来达到实现ViewPager的效果. 实际效果图如下: ...
- 【Android】知晓当前是哪一个活动
首先需要新建一个 BaseActivity 继承自Activity,然后在 BaseActivity 中重写 onCreate()方法,如下所示:public class BaseActivity e ...
- jQuery滑动并响应事件
jQuery滑动并打开指定页面: <!DOCTYPE html> <html> <head> <script src="http://code.jq ...
- Tomcat集群,Nginx集群,Tomcat+Nginx 负载均衡配置,Tomcat+Nginx集群
Tomcat集群,Nginx集群,Tomcat+Nginx 负载均衡配置,Tomcat+Nginx集群 >>>>>>>>>>>> ...
- jquery mobile入门资料
由于项目中用到了,就去看了一下视频,然后进一步的找找资源,最后自己再总结一遍!(就是动手操作一遍,不论你感觉多简单,只有动手之后,你才有可能有收获) 当然如果你喜欢看文档可以到官网仔细研究,不过喜欢快 ...
- 关于 ORA - 01861 文字与格式字符串不匹配问题(oracle存储过程)
一般问题(TO_DATE 和 TO_CHAR 两种格式互换)比如: 只要转化下格式就OK ,这里就不详细解释这两种格式的用法了! 今天把之前做好的模块拿到当地实习,不管怎么测 ,连续测试了好几个存储过 ...
- 手势识别=读取手机联系人=ContentResolver-Day3
手势识别=读取手机联系人=ContentResolverDay32 mobile3.0 手机设置向导页面完成 选择器没有做完成 样式提取完成 自定义控件的优化继续 抽取父类Activity 完成 手机 ...
- 新安装 wampserver 出现 You don't have permission to access / on this server. 或者访问数据库出现You don't have permission to access /phpmyadmin/ on this server.(解决方法)转
本地搭建wamp,输入http://127.0.0.1访问正常,当输入http://localhost/,apache出现You don't have permission to access/on ...