【问题标题】:Wsimport not including wsdl in client jar when wsdl is from url当 wsdl 来自 url 时,wsimport 不包括客户端 jar 中的 wsdl
【发布时间】:2013-08-22 16:05:09
【问题描述】:

我们正在从存储库管理我们的 wsdl,为了防止在本地复制 wsdl 并导致不同步,我们设置了我们的客户端(和服务)pom 以在构建时从 URL 中提取。

问题是客户端 jar 没有在其 META-INF 文件夹中包含 wsdls。每当我们尝试使用客户端调用我们的服务时,都会收到此错误:

08/22/2013@10:24 FATAL     -  2 counts of InaccessibleWSDLException.

com.sun.xml.internal.ws.wsdl.parser.InaccessibleWSDLException: 2 counts of
InaccessibleWSDLException.

java.io.IOException: Server returned HTTP response code: 401 for URL: "Repo-url"
java.io.IOException: Server returned HTTP response code: 401 for URL: "Repo-url"

这是使用 wsimport 的 pom 部分:

  <plugin>
        <groupId>org.jvnet.jax-ws-commons</groupId>
        <artifactId>jaxws-maven-plugin</artifactId>
        <version>2.1</version>
        <executions>
            <execution>
            <goals>
                <goal>wsimport</goal>
            </goals>
            <configuration>
                <extension>true</extension>
            </configuration>
            </execution>
        </executions>
        <configuration>
            <xauthFile>${basedir}/resources/authFile.txt</xauthFile>
            <wsdlUrls>               
                    <wsdlUrl>"Repo-url"</wsdlUrl>
                </wsdlUrls>
            <bindingFiles>
            <bindingFile>${basedir}/resources/binding.xjb.xml</bindingFile>
            </bindingFiles>
                <keep>true</keep>
        </configuration>
    </plugin>

在构建这种方式时,如何告诉插件也将 wsdl 包含到 jar 文件夹中?

【问题讨论】:

    标签: java wsdl wsimport


    【解决方案1】:

    您可以在客户端中尝试使用此注释吗?

    @WebServiceClient(name = "WSClient", targetNamespace = "http://yournamespace.com", wsdlLocation ="META-INF/wsdl/WSClient.wsdl"
    

    【讨论】:

    • 我们已经有那个注释,但是 wsdlLocation 指向那个“repo-url”而不是 meta-inf/wsdl/。似乎是整体问题的一部分,不包括 jar 的 meta-inf 文件夹中的 wsdl。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-08-20
    • 1970-01-01
    • 1970-01-01
    • 2013-09-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多