Axis 调用Soap代理模式设计
来源:互联网 发布:js 集合:{} 编辑:程序博客网 时间:2024/05/06 04:42
axis.jar
commons-discovery.jar
commons-logging.jar
jaxrpc.jar
1. Soap方法定义接口
public interface SoapService { public String getDatabaseConfiguration();}
2. 代理执行Soap定义的方法
public class SoapInvokerHandler implements InvocationHandler { private Call call; public void initCall() throws ServiceException { Service service = new Service(); call = (Call) service.createCall(); call.setTimeout(30000);// call.addHeader(new SOAPHeaderElement("", "ClientType", "Test")); call.setTargetEndpointAddress(String.format("http://%s/services/Test?wsdl", "127.0.0.1:8080")); } @Override public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { return call.invoke(method.getName(), args); }}
3. 使用
public class SoapInvokerFactory { public static SoapService getInvoker() throws ServiceException { SoapInvokerHandler invokerHandler = new SoapInvokerHandler(); invokerHandler.initCall(); SoapService service = (SoapService) Proxy.newProxyInstance(SoapService.class.getClassLoader(), new Class[] { SoapService.class }, invokerHandler); return service; } public static void main(String[] args) throws ServiceException { System.out.println(SoapInvokerFactory.getInvoker().getDatabaseConfiguration()); }}
- Axis 调用Soap代理模式设计
- Webservice调用方式:axis,soap
- java调用.NET的webservice实例的二种方法soap方式axis模式
- Webservice调用方式:axis,soap详解
- Webservice调用方式:axis,soap详解
- [SOAP] AXIS
- axis调用RMI模式WebService
- Domino代理调用远程Web Service(SOAP)
- 设计模式--【代理模式】
- 设计模式:代理模式
- 设计模式--代理模式
- 设计模式---代理模式
- 设计模式-代理模式
- 设计模式---代理模式
- 设计模式 代理模式
- 设计模式-【代理模式】
- 设计模式-代理模式
- 设计模式----代理模式
- linux下实现开机启动自己写的程序
- 连接字符串
- C#中的快捷键,可以更方便的编写代码
- 一步步构建大型网站架构
- 用 ElementTree 在 Python 中解析 XML
- Axis 调用Soap代理模式设计
- Two Sum
- git 添加忽略列表
- 探秘SensorHAL
- repeater 分页后取不到下一页的数据
- 1、GZIP压缩格式简介
- 出现未声明的标识符问题
- 用distcc和dmucs在ubuntu 10.04上搭建分布式编译环境
- 程序员面试 挺好的…………有感触!