zoukankan      html  css  js  c++  java
  • xfire调用示例

    xfire调用简单示例。

    import java.util.HashMap;
    import org.codehaus.xfire.XFireFactory;
    import org.codehaus.xfire.client.XFireProxyFactory;
    import org.codehaus.xfire.service.binding.ObjectServiceFactory;
    import org.codehaus.xfire.transport.http.CommonsHttpMessageSender;
    
    public class TestXfireCaller {
    	
    	private String ip = "1.1.1.1";
    	private String param1 = "111";
    	private String param2 = "222";
    	private String param3 = "S-Revcore-uncertify";
    	private int param4 = 5;
    	private MsgDeliveryService msgDeliveryService;
    
    	public void init() {
    		try {
    			HashMap<String, String> props = new HashMap<String, String>();
    			props.put(CommonsHttpMessageSender.HTTP_TIMEOUT, "180000");
    
    			org.codehaus.xfire.service.Service service = new ObjectServiceFactory()
    					.create(MsgDeliveryService.class, null,"com.xxx.xxx.management.service", props);
    			XFireProxyFactory factory = new XFireProxyFactory(XFireFactory
    					.newInstance().getXFire());
    			String wsdlUrl2 = "http://" + ip
    					+ ":8080/services/msgDeliveryService";
    			msgDeliveryService = (MsgDeliveryService) factory.create(service,
    					wsdlUrl2);
    		} catch (Exception e) {
    			e.printStackTrace();
    		}
    	}
    
    	public boolean remoteInterface() {
    		return msgDeliveryService.isMsgDeliveryDelayed(param1, param2, param3,
    				param4);
    	}
    
    	public static void main(String[] args) {
    		TestXfireCaller msgbrokerWSCaller = new TestXfireCaller();
    		msgbrokerWSCaller.init();
    		System.out.println("xfire调用结果=" + msgbrokerWSCaller.remoteInterface());
    	}
    
    }
    

      

  • 相关阅读:
    自定义view 画圆
    自定义view imageviw
    XML Stream
    Pull刷新加载
    Fragment事物
    Viewpager小圆点
    单个水波纹扩散
    多个彩色水波纹扩散效果
    自定义view
    获取sd的音乐文件
  • 原文地址:https://www.cnblogs.com/alipayhutu/p/3026832.html
Copyright © 2011-2022 走看看