aspose file tools*
The moose likes Web Services Certification (SCDJWS/OCEJWSD) and the fly likes Unable to establish connection to WSDL.  Failed to access the WSDL. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Services Certification (SCDJWS/OCEJWSD)
Bookmark "Unable to establish connection to WSDL.  Failed to access the WSDL." Watch "Unable to establish connection to WSDL.  Failed to access the WSDL." New topic
Author

Unable to establish connection to WSDL. Failed to access the WSDL.

Kumar Raja
Ranch Hand

Joined: Mar 18, 2010
Posts: 525
    
    2

Hello All,

I was curious to write a proxy client to some external webservices defined at http://xmethods.net and I chose the webservice that is based on Visual Data Flex and the service name is "Worldcup 2010 Football Championships". My excitement did not last longer, as I was not able to access the WSDL from my client .

Steps I followed.

1) I downloaded the WSDL and generated the client side artifacts using the wsimport tool and it was successful. I see all the required artifacts.
2) I tried to access the wsdl from browser through the link "http://footballpool.dataaccess.eu/data/info.wso?wsdl" and it was successful.
3) I wrote a client as below.



When I ran my client, it threw me an exception



I did not really understand the exception, as I can access this WSDL through browser. But why not from my client. I also failed to access this WSDL from Webservices Explorer in eclipse.

Please suggest.


Regards
KumarRaja

Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
I don't know if this is intentional on the behalf of the service provider. Perhaps they are checking the HTTP headers...
I ran a quick test with soapUI and am able to read the WSDL, send requests and obtain responses.
Best wishes!


My free books and tutorials: http://www.slideshare.net/krizsan
Kumar Raja
Ranch Hand

Joined: Mar 18, 2010
Posts: 525
    
    2

Ivan Krizsan wrote:Hi!
I don't know if this is intentional on the behalf of the service provider. Perhaps they are checking the HTTP headers...
I ran a quick test with soapUI and am able to read the WSDL, send requests and obtain responses.
Best wishes!


Thanks Ivan.

As I mentioned, I can access the WSDL through browser, but not through eclipse or through client. When you say intentional blocking and checking of headers, what specific headers they might be looking and blocking the connection and why is this not happening through browser. Would HTTP headers vary between the way it is accessed.

Also could you please shed some light on SOAPUI. What is it?

Thanks
Mikalai Zaikin
Ranch Hand

Joined: Jun 04, 2002
Posts: 3231
    
    6
Hello,

As an option you can download WSDL using browser, save on local disk and point wsdlLocation attribute to local copy of WSDL.

Best regards,
MZ


Free SCDJWS 5.0 Study Guide - SCDJWS 5.0 Quiz (How to get SCDJWS 5.0 Quiz)
Java Platform, Enterprise Edition 6 Web Services Developer Certified Expert Exam Study Guide and Quiz
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
soapUI is a program for testing various kinds of web service, both SOAP and RESTful.
There is a free version and I recommend you downloading and familiarizing yourself with this program, it is one of the more useful utilities I have come across in quite some time.
http://www.soapui.org/
I am in no way affiliated with the company behind soapUI.
Best wishes!
Niko Bellic
Greenhorn

Joined: Nov 07, 2014
Posts: 1
I have the exact same problem as the OP 4 years later.

I could use wsimport to generate the web service Java classes, but could not call the web service from Eclipse or from the command line using a jar. I got the same error as the OP...



That's the error you get if your computer cannot reach the WSDL (either because your internet is down, or you are behind some firewall, or whatever).

Any updates on a solution?

I switched my internet connection to the "guest" network instead of the company network, and everything worked. However, I would rather not have to do this every time I want to use a web service. There is a company proxy that we can use to access the internet freely while still remaining on the company network, and when I specify it in my browser (i.e. http://windows.microsoft.com/en-us/windows/change-internet-explorer-proxy-server-settings#1TC=windows-7), it allows me to go wherever BUT the web services still don't work! Do Java programs just simply ignore the proxy setting on your computer?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unable to establish connection to WSDL. Failed to access the WSDL.