【问题标题】:Get localhost:8080 instead of my_ip_address:8080 in wsdl2java在 wsdl2java 中获取 localhost:8080 而不是 my_ip_address:8080
【发布时间】:2012-12-07 07:17:35
【问题描述】:

我正在使用 axistools-maven-plugin

这是我的 xml 内容。

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>axistools-maven-plugin</artifactId>
    <version>1.4</version>
    <configuration>
    <urls>
       <url>http://localhost:8080/link/to/webservice?wsdl</url>
    </urls>
    <packageSpace>my.package</packageSpace>
    <serverSide>true</serverSide>
    <outputDirectory>src/main/java</outputDirectory>
    </configuration>
    <executions>
       <execution>
        <goals>
            <goal>wsdl2java</goal>
            </goals>
       </execution>
    </executions>
</plugin>

得到生成的输出为:

http://my_ip_address:8080/link/to/webservice

想要生成的输出为:

http://localhost:8080/link/to/webservice
     OR
http://127.0.0.1:8080/link/to/webservice

因为 http://my_ip_address:8080/link/to/webservice(我认为)会尝试从网络获取连接。我想在本地连接。

请帮忙..

更新:

它适用于 Windows XP,但不适用于 Linux (CentOS)。很抱歉没有提到这一点。

【问题讨论】:

    标签: web-services maven-plugin axis wsdl2java


    【解决方案1】:

    好吧,既然我没有得到答案,我想我找到了自己的答案。

    我不得不解决它。这是过程。

    1. 我使用目标机器本身下载 wsdl 文件。

    2. 更改端口地址。

      <service name="serviceName">
        <port name="servicePort" binding="tns:soapBinding">
          <soap:address location="http://localhost:8080/link/to/webservice"/>
        </port>
      </service>
      
    3. 在我的开发机器中使用那个 wsdl 文件。

    【讨论】:

      猜你喜欢
      • 2019-06-04
      • 2011-06-27
      • 1970-01-01
      • 2012-06-24
      • 1970-01-01
      • 2015-09-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多