user1386919
user1386919

Reputation:

There was an error downloading metadata from the address

I am trying to add service reference.

There was an error downloading metadata from the address

this is the error which is being displayed again and again?

Please help

Upvotes: 13

Views: 51485

Answers (10)

chprpipr
chprpipr

Reputation: 2039

I know this is an oldie, but I thought I would add what worked for me so that I can find it again down the road ;)

In my case, the AppPool user didn't have access the %Windir%\temp, which apparently is necessary in order for the MEX data to be generated.

Shout out to Amy Peng in this thread for her tip!

Upvotes: 1

cube45
cube45

Reputation: 4039

I had an issue like this one : Adding a service reference failed with a message "Method not allowed".

The wsdl worked fine in my browser..

The reason was that I configured the endpoint to listen on http://0.0.0.0:6000/mex, which the "Add Service Reference" tool doesn't seem to like. Changing it to a real IP address made it work (e.g. http://127.0.0.1:6000/mex)

Upvotes: 0

Graham Laight
Graham Laight

Reputation: 4840

Check IIS is serving the service URL. In my case, I had changed my Windows password, but had forgotten that these credentials were being used by IIS in both the application and the app pool.

Upvotes: 1

masospaghetti
masospaghetti

Reputation: 348

Try rebuilding the project first, if that does not fix it, try changing the property httpGetEnabled from FALSE to TRUE in your web.config.

  <serviceBehaviors>
    <behavior name="serviceBehavior">
      <serviceMetadata httpGetEnabled="true"/>
      <serviceDebug includeExceptionDetailInFaults="false"/>
    </behavior>
  </serviceBehaviors>

Upvotes: 1

ganjeii
ganjeii

Reputation: 1178

You may also just need to build / rebuild the project.

Upvotes: 19

Robin Purbia
Robin Purbia

Reputation: 227

Just try to Build the project without any error and give service reference again.

Upvotes: 4

karolanet333
karolanet333

Reputation: 51

It was happening the same to me and I found that I've had forgotten to add the "Service Contract" and the "Operation Contract" annotations on the interface of my WCF service

Upvotes: 4

Scott
Scott

Reputation: 2760

Another possibility in this situation is that there is no endpoint listening. I.e., the service you are trying to add isn't "up". I made this mistake when trying to add a reference to a WCF service I was working on, but I forgot to Open it.

Upvotes: 0

Zeni
Zeni

Reputation: 11

In Web.config file I changed :

 <endpoint address="" binding="pollingDuplexHttpBinding"
    contract="IAsyncTaskService"/>

to this :

<endpoint address="" binding="pollingDuplexHttpBinding"
    contract="DuplexService.Web.IAsyncTaskService"/>

and error was removed. Zeni

Upvotes: 1

Shiraz Bhaiji
Shiraz Bhaiji

Reputation: 65461

There are atleast 4 possibilities:

  • The metadata exchange mex endpoint is not defined
  • metadata exchange is not enabled
  • You are using the wrong address
  • You are being blocked by some security setting

Try the url in a browser to see that it returns a wsdl

Upvotes: 8

Related Questions