I am new to Java. I am developing one web application in which I want to consume web service. For this I have created on configuration xml with name "applicationContext.xml" in which is as below -
I have created one service interface with name "WebTestService.java" in which I have written
and in my controller I have written below -
LWhile running the code I am getting below error -
SEVERE: Servlet.service() for servlet [dispatcher] in context with path [/mysite] threw exception [Request processing failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'webTestService' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is javax.xml.ws.WebServiceException: Failed to access the WSDL at: http://www.webservicex.net/uszip.asmx?WSDL. It failed with:
Got Connection timed out: connect while opening stream from http://www.webservicex.net/uszip.asmx?WSDL.] with root cause
java.net.ConnectException: Connection timed out: connect
I did lots of googling but did not get any solution for it. Am I doing anything wrong here? Please suggest me the possible solutions.
Thanks in advance
Actually I am calling a remote web service which will return me Area information depending on zipcode which I am passing as a parameter.
You can check this link http://www.webservicex.net/uszip.asmx?WSDL in browser.