简体   繁体   English

当wsdl来自网址时,wsimport在客户端jar中不包括wsdl

[英]Wsimport not including wsdl in client jar when wsdl is from url

We are managing our wsdl from a Repository, and in order to prevent copying the wsdl locally and getting out of sync, We've set up our client (and service) poms to pull from the URL at build time. 我们正在从存储库中管理wsdl,为了防止在本地复制wsdl并使其不同步,我们已经设置了客户端(和服务)poms在构建时从URL中提取。

The problem is the client jar doesn't included the wsdls in its META-INF folder. 问题是客户端jar在其META-INF文件夹中未包含wsdls。 Whenever we try to use the client to call our service, we get this error: 每当我们尝试使用客户端调用我们的服务时,都会出现此错误:

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"

Here is the part of the pom using wsimport: 这是使用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>

How can I tell the plugin to also include the wsdl into the jar folder when building this way? 以这种方式构建时,如何告诉插件将wsdl也包含在jar文件夹中?

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

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM