簡體   English   中英

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

[英]Get localhost:8080 instead of my_ip_address:8080 in 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. 我使用目標計算機本身下載了wsdl文件。

  2. 更改端口地址。

     <service name="serviceName"> <port name="servicePort" binding="tns:soapBinding"> <soap:address location="http://localhost:8080/link/to/webservice"/> </port> </service> 
  3. 在我的開發機器上使用該wsdl文件。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM