views:

795

answers:

5

When trying to update the web reference to a deployed asp.net webservice from a windows forms app, I get an error.

Unable to download following files from .
https://webserver/webservices/myservice.asmx?wsdl

For some reason it is looking at a host called webserver, but that isn't what it needs to look for for the WSDL. It needs to look at the domain name that I put in for the web service reference to begin with. I suppose I have a problem in IIS.

What can I do to fix this?

A: 

i really doubt that there is a problem with the IIS, i would suggest you to remove the reference to webservice from your windows app and give the correct URL of the webservice once again.

also, accessing webservices over HTTPS brings in has its own share separate glitches so i would suggest that you try without HTTPS first, get it working and then go with the HTTPS.

Vikram
SAME PROBLEM after following advice.
Ronnie Overby
It would make sense that IIS is causing the issue, because it is looking for wsdl at the computer's name. I never typed the computers local name into any code.
Ronnie Overby
A: 

It sounds like you need to configure server bindings in IIS, specifically host header value, for https. In IIS 6, you can't do this via the IIS manager UI. You will need to run cscript adsutil.vbs. Take a look Configuring Server Bindings for SSL Host Headers (IIS 6.0).

Mehmet Aras
I have the same problem when not using SSL
Ronnie Overby
+2  A: 

Can you try using wsdl.exe to generate the proxy class for the same url?

wsdl /out:myProxyClass.cs https://<server>/webservices/myservice.asmx?wsdl
Gulzar
Thank you for the useful advice!
Ronnie Overby
glad it worked..:)
Gulzar
A: 

Following Gulzar's advice, I used wsdl.exe to generate the class, then went into the class and changed the server's local hostname to the internet accessible hostname.

BRILLIANT!

However, in the future I wont be able to just right click the web reference in my project and choose UPDATE SOLUTION. BUT WHO GIVES A CHEESE WHIZ?

Ronnie Overby
A: 

We had a VS 2003 1.1 web service, and could not connect with the wsdl definition failing to load.

Turns out the problem was a relative addressed Uri. I took two days to figure this out.

BAD: [ WebService (Namespace = "http://../MyWebService.com/"]

GOOD: [ WebService (Namespace = "http://tempuri.org/"]

verify the default namespace is an absolute address.

For more info visit: http://www.w3.org/TR/wsdl

Hope this helps

-1: @richard: thanks for trying to help, but your answer doesn't address the question at all. It's just something vaguely similar "couldn't use WSDL" that happened to you, but which has nothing to do with the current question.
John Saunders
Trying to add a webservice reference from a .Net 2.0 yeilds the exact same error for a webserice written in .Net 1.1 with:Unable to download following files from .https://webserver/webservices/myservice.asmx?wsdlThe issue is .Net 1.1 was more lax in its validation of the WDSL format. The .Net 2.0 framework will validate the uri and fail to connect to the webservice.Adding the reference via Visual Studio and going to the command line does the same thing. It helped me figure out what was wrong, but did not tell me why. This was my why, and as I said I hope it is helpful to someone.