2012-12-07 59 views
0

我使用axistools - Maven的插件获取本地主机:8080,而不是MY_IP_ADDRESS的:8080 WSDL2Java的

这是我的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 :8 080/link/to/webservice(我认为)会尝试从网络获得连接。我想在本地连接。

请帮助..

UPDATE:

它可以在Windows XP,但不是在Linux的版本(CentOS)。对不起,没有提到。

回答

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

相关问题