There was an error downloading metadata from the address
Asked Answered
C

10

13

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

Chalkstone answered 16/5, 2012 at 12:8 Comment(6)
please publish the wsdl or send me in emailLunna
if it is one small file paste it here. if it is big and have referenced files (e.g. "import" tags) send them all to me. I want to reproduce itLunna
basically after clicking on add service reference when i press ok it shows me a error : There was an error downloading metadata from the address please enter a valid URLChalkstone
Please post your web.config of the service you are trying to add.Andre
<configuration> <system.web> <compilation debug="true" targetFramework="4.0" /> </system.web> <system.serviceModel> <behaviors> <serviceBehaviors> <behavior name=""> <serviceMetadata httpGetEnabled="true" /> <serviceDebug includeExceptionDetailInFaults="false" /> </behavior> </serviceBehaviors> </behaviors> <serviceHostingEnvironment multipleSiteBindingsEnabled="true" /> </system.serviceModel> </configuration>Chalkstone
does we require to add something in web config of Visual studio 2010 to make this error out..Chalkstone
B
8

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

Broil answered 16/5, 2012 at 13:59 Comment(3)
<configuration> <system.web> <compilation debug="true" targetFramework="4.0" /> </system.web> <system.serviceModel> <behaviors> <serviceBehaviors> <behavior name=""> <serviceMetadata httpGetEnabled="true" /> <serviceDebug includeExceptionDetailInFaults="false" /> </behavior> </serviceBehaviors> </behaviors> <serviceHostingEnvironment multipleSiteBindingsEnabled="true" /> </system.serviceModel> </configuration>Chalkstone
The type 'SilverlightApplication6.Web.Service1', provided as the Service attribute value in the ServiceHost directive, or provided in the configuration element system.serviceModel/serviceHostingEnvironment/serviceActivations could not be found.Chalkstone
Browser displays the above message while posting the URL.Chalkstone
B
19

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

Bacolod answered 11/1, 2016 at 14:5 Comment(0)
B
8

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

Broil answered 16/5, 2012 at 13:59 Comment(3)
<configuration> <system.web> <compilation debug="true" targetFramework="4.0" /> </system.web> <system.serviceModel> <behaviors> <serviceBehaviors> <behavior name=""> <serviceMetadata httpGetEnabled="true" /> <serviceDebug includeExceptionDetailInFaults="false" /> </behavior> </serviceBehaviors> </behaviors> <serviceHostingEnvironment multipleSiteBindingsEnabled="true" /> </system.serviceModel> </configuration>Chalkstone
The type 'SilverlightApplication6.Web.Service1', provided as the Service attribute value in the ServiceHost directive, or provided in the configuration element system.serviceModel/serviceHostingEnvironment/serviceActivations could not be found.Chalkstone
Browser displays the above message while posting the URL.Chalkstone
M
4

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

Mariellamarielle answered 17/6, 2014 at 14:8 Comment(1)
Same if you forgot [DataContract] on classes that you want to use.Arellano
J
4

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

Jason answered 12/9, 2015 at 13:4 Comment(1)
This ans Helped for meVanya
U
1

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

Uncommonly answered 23/2, 2013 at 4:37 Comment(0)
B
1

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>
Balustrade answered 29/7, 2016 at 13:37 Comment(0)
H
1

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.

Hippocrates answered 10/11, 2016 at 9:37 Comment(0)
P
1

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!

Psycho answered 21/12, 2016 at 21:1 Comment(0)
P
0

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.

Penneypenni answered 2/12, 2013 at 23:7 Comment(0)
V
0

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)

Vasili answered 16/11, 2016 at 14:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.