在wsdl2java中获取localhost:8080而不是my_ip_address:8080

时间:2012-12-07 07:17:36

标签: web-services maven-plugin axis wsdl2java

我正在使用 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)。很抱歉没有提到。

1 个答案:

答案 0 :(得分:0)

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

我不得不做一些工作。这是过程。

  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文件。

相关问题