cxf CXF搭建webService服务器
2021-06-21 03:02
标签:get server ack ring 服务器 3.1 oid wsdl2java ade http://observer.blog.51cto.com/4267416/1231205 手动发布: public class ServerMain { public static void main(String[] args) { 客户端调用 使用wsdl2java 生成的代码,运行时出现错误,删除包xfire-all-1.2.6可以运行了,实际不用导入任何包就可以运行。 注:wsdl2java 在 apache-cxf-3.1.12 的bin目录下面 cxf CXF搭建webService服务器 标签:get server ack ring 服务器 3.1 oid wsdl2java ade 原文地址:http://www.cnblogs.com/newlangwen/p/7183731.html
GradeService service = new GradeServiceImpl();
Endpoint.publish("http://localhost/webservices/services/Service", service);
}
}package com.test.service;
public class ClientMain {
public static void main(String[] args) throws Exception {
GradeService_Service service = new GradeService_Service();
GradeService gradeServiceImplPort = service.getGradeServicePort();
System.out.println(gradeServiceImplPort.getGradeName(111));
//JaxWsDynamicClientFactory clientFactory = JaxWsDynamicClientFactory.newInstance();
//Client client = clientFactory.createClient("http://localhost/webservices/services/Service?wsdl");
//Object[] result = client.invoke("getGradeName", 11);
//System.out.println(result[0]);
}
}
文章标题:cxf CXF搭建webService服务器
文章链接:http://soscw.com/index.php/essay/96703.html