1: 首先把证书导出
点击这把锁的标识,弹出
查看证书
点导出,生在一个myKey.cer 文件
2:然后根据这个.CER文件生成.trustStore 文件
keytool -import -file f:/myKey.cer -storepass netconfig -keystore f:/crtTrust.trustStore config -noprompt
3: 在需要用倒的地方加上
System.setProperty("javax.net.ssl.trustStore","f:/crtTrust.trustStore");
System.setProperty("javax.net.ssl.trustStorePassword", "netconfig");
4:如果服务器端需要用户名的密码验证,那得把用户名和密码传进去
System.setProperty("javax.net.ssl.trustStore","f:/crtTrust.trustStore");
System.setProperty("javax.net.ssl.trustStorePassword", "netconfig");
/**
* keytool -import -file f:/net.cer -storepass netconfig -keystore f:/crt1.trustStore -noprompt
* 生成 f:/crt1.trustStore 和 f:/crt 这两个文件都行。
*/
try
{
RPCServiceClient serviceClient = new RPCServiceClient();
Options option = serviceClient.getOptions();
// http://localhost:8087/HelloWord 访问 WSDL的路径名称
//https://localhost:8080/server/security?wsdl
EndpointReference tReference = new EndpointReference("https://localhost:8080/server/launchers?wsdl");
option.setTo(tReference);
Authenticator authenticator = new Authenticator();
List<String> auth = new ArrayList<String>();
auth.add(Authenticator.BASIC);
authenticator.setAuthSchemes(auth);
authenticator.setUsername("admin");
authenticator.setPassword("password");
authenticator.setPreemptiveAuthentication(true);
option.setProperty(HTTPConstants.AUTHENTICATE, authenticator);
// 指定 sayHello 方法的参数 返回值对象
Class[] classes = new Class[] { List[].class };
//调用sayHello 的方法 及 WSDL 的命名空间 (注意:是WSDL中的namespace 属性 (在这里犯了一个大错))
// http://www.netconfig.org/server/security listUsers
QName qName = new QName("http://www.netconfig.org/server/launchers", "getLaunchers");
/**
* qName :表示方法名
*
* opAddEntryArgs :参数类型 object[]
*
* classes :返回值 类型 class
*/
Object[] obj = serviceClient.invokeBlocking(qName, new Object[] {}, classes);
List[] list_arr = (List[])obj[0];
for (int i= 0 ; i < list_arr.length; i ++)
{
List list_ = list_arr[i];
for (int j = 0 ; j < list_.size() ;j ++)
{
OMElementImpl omElementImpl = (OMElementImpl)list_.get(j);
System.out.println("localname--"+omElementImpl.getLocalName());
System.out.println("text--"+omElementImpl.getText());
}
//System.out.println("str---"+string_arr[i]);
}
}
catch (Exception e){
e.printStackTrace();
}
- 大小: 14.2 KB
- 大小: 1.6 KB
- 大小: 24.6 KB
分享到:
相关推荐
Chapter 1, Apache Web Services and Axis2 - Gives you an introduction to web services and the web service stack at Apache. Chapter 2, Looking inside Axis2 - Learn about Axis2 architecture and the ...
用axis2开发web services 所需jar包
包括3本Axis2的书(英文),實為2本(第1本有...1.Developing Web Services with Apache CXF and Axis2, 3rd Edition 2.Packt.Publishing.Quickstart.Apache.Axis2 3.Develop Web Services With Apache Axis2 PDF格式
用axis2开发Web Services,内容包括环境搭建,插件安装,以及用axis2开发Web Services的详细步骤及实例程序;
Extensive and detailed coverage of the enterprise ready Apache Axis2 Web Services / SOAP / WSDL engine. Attain a more flexible and extensible framework with the world class Axis2 architecture. Learn ...
一、Axis的安装 <br/>应用Axis开发Web Services,你需要安装如下软件: 1.JDK1.4.2或以上 2.http://ws.apache.org/axis/dist/1_1/下载得到 3.一个支持Servlet的服务器引擎,比如广为人知的Tomcat。...
插件共分两个,这是的一个 让你在eclipse下开发WebServices更加的简单 AXIS的相关开发文档,将在后续发给大家
使用Java+Axis2调用Web Services 网络接口,代码中列举4个例子可以查看,有详细注释提供参考。
Axis2集成Spring发布WebServices服务
Java 中,使用axis来实现webServices 里面包含Word详细说明使用webservices的步骤, 看了就会啦, 使用webServicers里面jar ,和工具都包含在里面。。。 如果你要实现webservies的话, 不看后悔死你。。。。
用axis1开发Web Services入门,包括axis1插件的安装,环境的配置以及Web Services入门程序。
axis开发webservices.doc
本项目是在实际开发调用webservices接口时的做的例子。使用Axis技术开发。 其中包含webservices开发,以及webservices调用。 运行项目后输入:http://localhost:8080/webserviceDemo/services/helloService?wsdl ...
插件共分两个,这是的二个 让你在eclipse下开发WebServices更加的简单 AXIS的相关开发文档,将在后续发给大家
这是关于axis开发webservices的完整资料
axis+webservices开发教程
Axis2教程比较好用,适合初学者。Axis2教程比较好用,适合初学者。
axis 实现 web services java 实例 webservices 参考:http://blog.csdn.net/chinarenzhou/article/details/7609953
Apache Axis2 Web Services 2nd Edition
java axis Webservices实例