hellospringclient.java

来自「用spring整合xfire来实现web service」· Java 代码 · 共 29 行

JAVA
29
字号
package com.poson.xfire.spring.test;

import org.codehaus.xfire.client.XFireProxyFactory;
import org.codehaus.xfire.service.Service;
import org.codehaus.xfire.service.binding.ObjectServiceFactory;

import com.poson.xfire.spring.HelloSpring;

public class HelloSpringClient {
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		 String serviceURL = "http://localhost:8411/XfireSpring/services/HelloSpring";
	        Service serviceModel = new ObjectServiceFactory().create(HelloSpring.class);
	        XFireProxyFactory serviceFactory = new XFireProxyFactory();
	        try
	        {
	        	HelloSpring service = (HelloSpring) serviceFactory.create(serviceModel, serviceURL);
	           System.out.println(service.sayHello("topquan")); 
	        }
	        catch (Exception e)
	        {
	            e.printStackTrace();
	        }
	}

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?