How to configure a proxy server for wsdl2java ant?

I am trying to do this:

<target name="generate" depends="clean,init">
  <mkdir dir="${source.dir}/generated"/>
  <java classname="org.apache.cxf.tools.wsdlto.WSDLToJava" fork="true">
    <sysproperty key="http.proxyHost" value="proxy.example.com"/>
    <sysproperty key="http.proxyPort" value="8080"/>
    <sysproperty key="http.proxyUser" value="secretUser"/>
    <sysproperty key="http.proxyPassword" value="complexPass"/>
    <arg value="-d"/>
    <arg value="${source.dir}/generate"/>
    <arg value="-client"/>
    <arg value="http://example.com/WS?wsdl"/>
    <classpath refid="project.classpath"/>
  </java>
</target>

And when I run the target, I get the 407 error required by auth

Problem parsing 'http://example.com/WS?wsdl'.: java.io.IOException: Server returned HTTP response code: 407 for URL: http://example.com/WS?wsdl 

I get the same error if I install the https proxy, and when I do not install the proxy server, I get:

Problem parsing 'http://example.com/WS?wsdl'.: java.net.ConnectException: Connection refused 

I am also trying to use the wrong password to check if error 401 returns, but 407 is returned.

+4
source share
1 answer

In http://example.com/WS?wsdlno service. This is just an example of a web address. You need to enter a real web service URI that points to a valid WSDL for this service. For example.

http://ws.cdyne.com/emailverify/Emailvernotestemail.asmx?WSDL

+1
source

Source: https://habr.com/ru/post/1629025/


All Articles