0

I am trying a simple soap consumer using spring-ws for the URL http://www.dneonline.com/calculator.asmx?wsdl.

I either get 403 forbidden error for the URL

wsimport -keep -s ./src -d ./dest http://www.dneonline.com/calculator.asmx?wsdl

or

connection timeouts for the URL

wsimport http://www.dneonline.com/calculator.asmx?wsdl

complete error :

parsing WSDL...

[ERROR] Connection timed out: connect

Failed to read the WSDL document: http://www.dneonline.com/calculator.asmx?wsdl, because 1) could not find the document; /2) the document could not be read; 3) the root element of the document is not .

[ERROR] Could not find wsdl:service in the provided WSDL(s):

At least one WSDL with at least one service definition needs to be provided.

Failed to parse the WSDL.

Also tried :

java -Dhttp.proxyHost=proxy.orgname.com -Dhttp.proxyPort=9000 -Dhttp.nonProxyHosts="localhost|*.intranet-domain.com" -classpath %JAVA_HOME%\lib\tools.jar com.sun.tools.internal.ws.WsImport -p com.ws.client.pkg http://www.dneonline.com/calculator.asmx?wsdl

errors out saying the tools.jar is not found even though it exits.

Raghuveer
  • 2,859
  • 7
  • 34
  • 66

1 Answers1

0

You are likly to be behind a corporate proxy. Please try to use this solution to set the proxy for wsimport.

markusw
  • 1,975
  • 16
  • 28
  • when I run the command I see the erro `Error: Could not find or load main class Files\Java\jdk1.8.0_162\lib\tools.jar` even though the jar is exists. – Raghuveer Mar 27 '18 at 07:23
  • Please stick to the answer. You should not execute tools.jar, but WsImport. – markusw Mar 27 '18 at 07:29
  • Unable to open the link you provided however I also tried `java -Djava.net.useSystemProxies=true wsimport -p com.ws.client.pkg http://www.dneonline.com/calculator.asmx?wsdl` but in vain. I see error `Error: Could not find or load main class wsimport` – Raghuveer Mar 27 '18 at 07:34