0

Maven プロジェクトで使用する必要がある HTTPS WSDL URL (https://hostname/MyApp/MyApp.svc?wsdl) があります。WSDL の証明書は期限切れで、hostname.company.com に発行されます。

Maven pom.xml に次のコードがあります

<dependencies>
    <dependency>
        <groupId>com.sun.xml.ws</groupId>
        <artifactId>jaxws-rt</artifactId>
        <scope>compile</scope>
        <version>2.1.3</version>
    </dependency>
</dependencies>
<build>
    <plugins>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>jaxws-maven-plugin</artifactId>
            <version>1.10</version>
            <executions>
                <execution>
                    <goals>
                        <goal>wsimport</goal>
                    </goals>
                    <configuration>
                        <sourceDestDir>${project.build.directory}/generated-sources/jaxws-wsimport</sourceDestDir>                          
                        <wsdlUrls>
                            <wsdlUrl>https://hostname/MyApp/MyApp.svc?wsdl</wsdlUrl>
                        </wsdlUrls>                           
                    </configuration>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

クリーンしてビルドすると、次のエラーが発生します

[jaxws:wsimport]
Processing: https://hostname/MyApp/MyApp.svc?wsdl
jaxws:wsimport args: [-s, C:\WorkspaceNetBeans\Maven\WSTest\target\generated-sources\jaxws-wsimport, -d, C:\WorkspaceNetBeans\Maven\WSTest\target\classes, https://hostname/MyApp/MyApp.svc?wsdl]
parsing WSDL...

java.security.cert.CertificateException: No name matching hostname found

Failed to read the WSDL document: https://hostname/MyApp/MyApp.svc?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>. 

failed.noservice=Could not find wsdl:service in the provided WSDL(s): 

 At least one WSDL with at least one service definition needs to be provided.

    Failed to parse the WSDL.

keytool ユーティリティを使用して証明書をキーストアに追加しました。他に何をする必要がありますか?

4

2 に答える 2

1

wsdl を Web ブラウザからローカルにダウンロードし、そのローカル ファイルで wsimport を実行して Java モデルを生成できます。

于 2012-12-28T17:08:16.413 に答える
0

可能なオプションがあります:

1) サーバーの証明書を信頼ストアにインポートし、サーバー証明書に示されている CN 名が使用しているホスト名と同じであることも確認します。このリンクが役に立ちます: http://bluefoot.info/howtos/how-to-void-java-security-cert-certificateexception-no-name-matching-localhost-found/

2) Netbeans や eclipse など、サーバーの SSL の側面を無視できるツールを使用します (私には疑問ですが)。

3) 依存するすべての XSD 参照を解決する WSDL のローカル バージョンを作成し、その WSDL を使用します。

于 2012-12-28T17:57:20.457 に答える