81,091
社区成员
发帖
与我相关
我的任务
分享
//初始化服务
UpcardHttpsServiceStub stub;
//加载认证
System.setProperty("javax.net.ssl.keyStore","E:/jks/1.jks");
System.setProperty("javax.net.ssl.keyStorePassword","1&123");
System.setProperty("javax.net.ssl.trustStore","E:/jks/2.trust.jks");
System.setProperty("javax.net.ssl.trustStorePassword","2&123");
ConfigurationContext ctx = ConfigurationContextFactory.createConfigurationContextFromFileSystem("E:/jks/client_repo",null);
stub = new UpcardHttpsServiceStub(ctx,"https://*:*/mcws/services/upcardHttpsService?wsdl");
ServiceClient sc = stub._getServiceClient();
try {
sc.engageModule("rampart");
}catch(Exception e) {
System.out.println("无法加载[rampart]模块:"+e.getMessage());
}
Options options = sc.getOptions();
options.setUserName("name");
options.setPassword("123456");