I use jaxws-maven-plugin to produce java from wsdl. wsdl located in local network, but refers to some xsd in internet.
It becomes troubles in generation code with maven plugin, becouse it has lack of advanced http proxy settings.
Is there a workaround for this issue? My config is:
<plugin>
<groupId>org.jvnet.jax-ws-commons</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>2.2</version>
<executions>
<execution>
<goals>
<goal>wsimport</goal>
</goals>
</execution>
</executions>
<configuration>
<!--<httpproxy>127.0.0.1:5865</httpproxy>-->
<packageName>my.pkg</packageName>
<verbose>true</verbose>
<wsdlUrls>
<wsdlUrl>
http://10.31.7.64:13080/service.wsdl
</wsdlUrl>
</wsdlUrls>
</configuration>
</plugin>
Without proxy I got
parsing WSDL...
[ERROR] IOException thrown when processing "http://www.w3.org/2005/05/xmlmime". Exception: java.net.ConnectException: Connection refused: connect.
With proxy I got
parsing WSDL...
[ERROR] Server returned HTTP response code: 504 for URL: http://10.31.7.64:13080/service.wsdl
May be it problem of proxy, but I don't have another proxy behind corporate network.
AFAIU, when we enable the httpproxy
, all request will go to that proxy, including with the <wsdlUrl>
.
The server returns
HTTP response code: 504 for URL: http://10.31.7.64:13080/service.wsdl
The Status Code Definitions told us as the following: -
504 Gateway Timeout
The server, while acting as a gateway or proxy, did not receive a timely response from the upstream server specified by the URI (e.g. HTTP, FTP, LDAP) or some other auxiliary server (e.g. DNS) it needed to access in attempting to complete the request.
The root cause may be the proxy does not known our address, in this case it is 10.31.7.64
IMHO please try to download the wsdl
and put it to local machine. Then configured by using the wsdlFiles as the following example: -
<configuration>
<wsdlFiles>
<wsdlFile>${basedir}/path/to/wsdl</wsdlFile>
</wsdlFiles>
</configuration>
I hope this may help.