XFire根据WSDL生成客户端程序
来源:互联网 发布:c语言移位指令 编辑:程序博客网 时间:2024/05/22 06:25
XFire根据WSDL生成客户端程序
1.更新The XFire Eclipse plugin
The XFire Eclipse plugin provides Eclipse support for XFire's WSDL->Code generator. It requires Eclipse 3.2 and Java 5.
Installing the Plugin
To install the Eclipse XFire plugin:
go to the Help menu, select "Software Updates" and then select "Find and Install."
Select "Search for new features to install" and click Next.
Select "Create New Remote Site" and enter "XFire" as the name and http://dist.codehaus.org/xfire/update/ as the eclipse update site.
Select OK.
Select Finish
2.安装好后出现
3.新建一个web project,将
生成的client程序放到源文件夹中,
不要加myeclipse中的XFire库文件,因为客户端运行所导入的xfire
直接下载xfire-
4.最后写个测试程序就好。
import com.kuaff.xfire.samples.MathServiceClient;
import com.kuaff.xfire.samples.MathServicePortType;
public class Test {
public static void main(String[] args) {
MathServiceClient client = new MathServiceClient();
MathServicePortType MathService = client.getMathServiceHttpPort();
// 调用服务
long result = MathService.add(1, 2);
System.out.println("结果:" + result);
}
}
当有参数传递时,
import test.HelloServiceClient;
import test.HelloServicePortType;
import test.ObjectFactory;
import test.User;
import javax.xml.namespace.QName;
public class TestAddress {
public static void main(String[] args) {
HelloServiceClient client = new HelloServiceClient();
HelloServicePortType HelloService = client.getHelloServiceHttpPort();
// 当要传递参数时,调用ObjectFactory中的公用方法,而不用自己还要
//new JAXBElement<String>(new
// QName("http://test", "username"),String.class,"dfdfs");
//直接调用factory.createUserUsername("dfdfs")返回JAXBElement<String>类型
ObjectFactory factory=new ObjectFactory();
User user=factory.createUser();
user.setPassword(factory.createUserPassword("afdsafsd"));
user.setUsername(factory.createUserUsername("dfdfs"));
// 调用服务
//由JAXBElement转化为String,调用getValue();
System.out.println(HelloService.getUser(user).getUsername().getValue());
}
}
- XFire根据WSDL生成客户端程序
- XFire根据WSDL生成客户端程序
- 根据wsdl文件使用xfire生成webservice客户端
- XFire使用WSDL生成客户端代码
- 根据WSDL生成Services客户端
- 根据wsdl文件生成客户端
- 根据wsdl生成java客户端
- XFire下根据WSDL生成Client Stub,并测试Client
- XFire下根据WSDL生成Client Stub,并测试Client
- XFire下根据WSDL生成Client Stub,并测试Client
- 一个根据wsdl生成xfire stub的应用问题
- axis2根据wsdl生成客户端代码
- 根据wsdl文件生成java代理客户端
- axis1.4 根据wsdl生成 客户端
- 如何根据wsdl文件生成客户端
- websevice根据wsdl生成客户端代码
- 使用Xfire从WSDL生成客户端(详)
- webService---使用Xfire从WSDL生成客户端(详)
- ASP.NET中17种正则表达式
- [Hacking VIM]之定制:切换菜单和工具栏
- 基于VC++的OpenGL编程讲座之基本图元
- 小软件项目开发的管理
- 如何制定和编写软件项目计划
- XFire根据WSDL生成客户端程序
- 探求学习嵌入式系统的最优解-连载3
- JavaScript常用語句
- 如何使用web_reg_save_param方法保存的多个参数?
- 常用SQL语句词典
- 项目管理案例剖析
- 遍历页面内所有一类控件并做相关操作
- 面试的技巧
- 关于CHECKBOX的两个问题