【问题标题】:How to generate jax ws artifacts from wsdl over ssl如何通过 ssl 从 wsdl 生成 jax ws 工件
【发布时间】:2016-03-04 16:37:39
【问题描述】:

我需要为我的 jaxws 客户端从 wsdl 生成 jax ws 工件 我的代码如下:

String keystore = "D:\\mycert/mr.jks";
String storepass = "changeit";
String storetype = "JKS";

String[][] props = {
    {"javax.net.ssl.trustStore", keystore},
    {"javax.net.ssl.keyStore", keystore},
    {"javax.net.ssl.keyStorePassword", storepass},
    {"javax.net.ssl.keyStoreType", storetype}
};
for (String[] prop : props) {
    System.getProperties().setProperty(prop[0], prop[1]);
}
ProcessBuilder builder = new ProcessBuilder(
    "cmd.exe", "/c", "wsimport -keep -verbose https://some.sw.somewhere.az:5555/?wsdl");
builder.redirectErrorStream(true);
Process p = builder.start();
BufferedReader r = new BufferedReader(new InputStreamReader(p.getInputStream()));
String line;
while (true) {
    line = r.readLine();
    if (line == null) {
        break;
    }
    System.out.println(line);
}

正在解析 WSDL...

[ERROR] sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Failed to read the WSDL document: https://some.sw.somwhere.com:5555/?wsdl, because 1) could not find the document; /2) the document could not be read; 3) the root element of the document is not <wsdl:definitions>.
[ERROR] failed.noservice=Could not find wsdl:service in the provided WSDL(s): 

需要提供至少一个具有至少一个服务定义的 WSDL。 解析 WSDL 失败。

【问题讨论】:

    标签: java jax-ws wsimport


    【解决方案1】:

    我用 SOAPUI 解决了这个问题,source

    【讨论】:

      猜你喜欢
      • 2012-08-09
      • 2012-11-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多