ssh+cxf webservices完整版
完整代码,包括jar包,下载即可运行!有什么不妥的,欢迎大家评论批评!
代码片段和文件信息
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2013-05-10 09:30 cxftest
文件 7406 2013-05-07 10:24 cxftest.classpath
目录 0 2013-05-02 11:16 cxftest.myeclipse
文件 294 2013-05-02 11:16 cxftest.mymetadata
文件 1413 2013-05-02 11:20 cxftest.project
目录 0 2013-05-10 09:30 cxftest.settings
文件 500 2013-05-02 11:16 cxftest.settings.jsdtscope
文件 88 2013-05-02 11:17 cxftest.settingsorg.eclipse.core.resources.prefs
文件 629 2013-05-02 11:18 cxftest.settingsorg.eclipse.jdt.core.prefs
文件 49 2013-05-02 11:16 cxftest.settingsorg.eclipse.wst.jsdt.ui.superType.container
文件 6 2013-05-02 11:16 cxftest.settingsorg.eclipse.wst.jsdt.ui.superType.name
目录 0 2013-05-10 09:30 cxftestsrc
目录 0 2013-05-10 09:30 cxftestsrccom
文件 95 2012-01-31 15:55 cxftestsrccommons-logging.properties
目录 0 2013-05-10 09:30 cxftestsrccomcxftest
目录 0 2013-05-10 09:30 cxftestsrccomcxftestdao
文件 447 2013-05-10 09:28 cxftestsrccomcxftestdaoAdminDao.java
文件 1771 2013-05-10 09:28 cxftestsrccomcxftestdaoaseDao.java
目录 0 2013-05-10 09:30 cxftestsrccomcxftestdaoimpl
文件 848 2013-05-10 09:28 cxftestsrccomcxftestdaoimplAdminDaoImpl.java
文件 4580 2013-05-10 09:28 cxftestsrccomcxftestdaoimplaseDaoImpl.java
目录 0 2013-05-10 09:30 cxftestsrccomcxftestentity
文件 6194 2013-05-10 09:28 cxftestsrccomcxftestentityAdmin.java
文件 2637 2013-05-10 09:28 cxftestsrccomcxftestentityaseEntity.java
目录 0 2013-05-10 09:30 cxftestsrccomcxftestfilter
文件 1897 2013-05-10 09:28 cxftestsrccomcxftestfilterEncodingConvertFilter.java
目录 0 2013-05-10 09:30 cxftestsrccomcxftestservice
文件 790 2013-05-10 09:27 cxftestsrccomcxftestserviceAdminService.java
文件 1686 2013-05-10 09:27 cxftestsrccomcxftestserviceaseService.java
目录 0 2013-05-10 09:30 cxftestsrccomcxftestserviceimpl
文件 1597 2013-05-10 09:27 cxftestsrccomcxftestserviceimplAdminServiceImpl.java
............此处省略160个文件信息
package com.cxftest;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.methods.GetMethod;
public class TestMain {
/**
* @title: main
* @Description: TODO(这里用一句话描述这个方法的作用)
* @param @param args 设定文件
* @return void 返回类型
* @throws
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
try {
all();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public static void all() throws Exception{
GetMethod get = new GetMethod(“http://localhost:8080/cxftest/services/user/query/1/1/1“);
get.setRequestHeader(“accept““application/json“);
HttpClient hc = new HttpClient();
hc.getParams().setContentCharset(“UTF-8“); //设置编码
int code = hc.executeMethod(get);
System.err.println(“返回的状态码:“+code);
if(code==200){
String str = get.getResponseBodyAsString();
System.err.println(“返回信息:
“+str);
}
get.releaseConnection();
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2013-05-10 09:30 cxftest
文件 7406 2013-05-07 10:24 cxftest.classpath
目录 0 2013-05-02 11:16 cxftest.myeclipse
文件 294 2013-05-02 11:16 cxftest.myme
文件 1413 2013-05-02 11:20 cxftest.project
目录 0 2013-05-10 09:30 cxftest.settings
文件 500 2013-05-02 11:16 cxftest.settings.jsdtscope
文件 88 2013-05-02 11:17 cxftest.settingsorg.eclipse.core.resources.prefs
文件 629 2013-05-02 11:18 cxftest.settingsorg.eclipse.jdt.core.prefs
文件 49 2013-05-02 11:16 cxftest.settingsorg.eclipse.wst.jsdt.ui.superType.container
文件 6 2013-05-02 11:16 cxftest.settingsorg.eclipse.wst.jsdt.ui.superType.name
目录 0 2013-05-10 09:30 cxftestsrc
目录 0 2013-05-10 09:30 cxftestsrccom
文件 95 2012-01-31 15:55 cxftestsrccommons-logging.properties
目录 0 2013-05-10 09:30 cxftestsrccomcxftest
目录 0 2013-05-10 09:30 cxftestsrccomcxftestdao
文件 447 2013-05-10 09:28 cxftestsrccomcxftestdaoAdminDao.java
文件 1771 2013-05-10 09:28 cxftestsrccomcxftestdaoa
目录 0 2013-05-10 09:30 cxftestsrccomcxftestdaoimpl
文件 848 2013-05-10 09:28 cxftestsrccomcxftestdaoimplAdminDaoImpl.java
文件 4580 2013-05-10 09:28 cxftestsrccomcxftestdaoimpla
目录 0 2013-05-10 09:30 cxftestsrccomcxftestentity
文件 6194 2013-05-10 09:28 cxftestsrccomcxftestentityAdmin.java
文件 2637 2013-05-10 09:28 cxftestsrccomcxftestentitya
目录 0 2013-05-10 09:30 cxftestsrccomcxftestfilter
文件 1897 2013-05-10 09:28 cxftestsrccomcxftestfilterEncodingConvertFilter.java
目录 0 2013-05-10 09:30 cxftestsrccomcxftestservice
文件 790 2013-05-10 09:27 cxftestsrccomcxftestserviceAdminService.java
文件 1686 2013-05-10 09:27 cxftestsrccomcxftestservicea
目录 0 2013-05-10 09:30 cxftestsrccomcxftestserviceimpl
文件 1597 2013-05-10 09:27 cxftestsrccomcxftestserviceimplAdminServiceImpl.java
............此处省略160个文件信息
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。
评论列表(条)