webservice中调用本地session,request
来源:互联网 发布:java招聘深圳 编辑:程序博客网 时间:2024/04/20 02:39
1利用apache cxf编写webservice(在此总结并分享,有错误不吝指教(暂时是个小菜鸟。。))
2cxf-servlet中添加元素
<jaxws:endpoint
id="helloWorld"
implementor="com.xxx.xxx.impl.HelloWorldServiceImp"
address="/HelloWorld" />
3导入jetty,jetty-util.jar
4service inteface:
@WebService
public interface HelloWorldService{
public String test();
}
5 service implement:
@WebService(endpointInterface = "com.xxx.xxx.HelloWorldService")
public class HelloWorldServiceImp implements HelloWorldService {
//引入webserviceContext ,提供各web元素
@Resource
private WebServiceContext context;
@Override
public String test() {
System.out.println(context.getMessageContext().get(MessageContext.SERVLET_CONTEXT));
return "AA";
}
}
6测试:
public class Client{
public Client() {
// TODO 自动生成构造函数存根
}
public static void main(String[] args) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException {
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
factory.setServiceClass(HelloWorldService.class);
factory.setAddress("http://localhost:8080/xxx/xxx/HelloWorld");
HelloWorldService client = (HelloWorldService) factory.create();
System.out.println(client.test());
}
}
- webservice中调用本地session,request
- Winform中通过WebService调用session
- WebService中应用HttpContext(Request、Response、Session、Application)
- WebService调用Session
- Struts2中调用response,request,session的方法
- 调用WebService方法 Session丢失
- android 调用webservice保持session
- webservice生成本地客户端调用
- webservice 中 获取 session
- Struts2中获取Session,Request
- Action中获取session,request
- 在request的对象中调用在session中的对象的内容(JSF)
- 在DWR调用的java代码中使用Session,Request,Response等
- 在DWR调用的java代码中使用Session,Request,Response等
- 如何在jsp页面调用的java类中获取当前线程的request和session
- Webservice中使用Session、Application
- Webservice中使用Session、Application
- 在webservice中使用session
- 瑞星将面临历史上最艰苦的一场战役(二)
- TBB源码阅读计划
- flex 和php 通信
- 豆丁网缓存docin离线浏览(提供源码)修改,已更新
- 鼓励自己最有效的20个方法
- webservice中调用本地session,request
- 添加jquery下拉
- 新的一年:虎虎生风
- Rex 操作系统
- 设计模式快速参考 - Design Patterns Quick Reference
- C++友元
- 利用flex builder 来开发php
- json.org例子
- xml operation