6

I am trying to add web reference when adding web reference url in windows application it shows error like this. how do i solve it?

There was an error downloading 'http://www.example.com/BackEndWebService/LoginWebService.asmx/$metadata'.

The request failed with the error message:

$metadata Web Service method name is not valid.

Ct.Manoj
  • 63
  • 1
  • 1
  • 5
  • Are you adding it as a web reference, or a service reference? Web references are deprecated. – Nikki9696 Mar 29 '16 at 18:17
  • I am adding it as Service Reference which displays dailogue box , in advanced button i clicked Add Web Reference and enter the url – Ct.Manoj Mar 30 '16 at 06:33
  • Can you open it in a browser? There might be an issue with the web service. See http://blog.consejoinc.com/2012/12/interesting-cause-for-exception.html – Nikki9696 Mar 30 '16 at 13:39
  • yes,i open it in a bowser and it is working well.. – Ct.Manoj Mar 31 '16 at 05:32
  • Just had the same issue, I finally figured out that selecting the service on VS and going to properties shows the url, just changed it and it worked. – Red Jun 16 '16 at 04:01

2 Answers2

18

I had the same issue the other day when tried to update the web reference and managed to fix it by adding ?WSDL at the end. That should work.

enter image description here

  • Thanks! In my case was a external java web service and I replaced the dot by a question mark: https://webservice.web/webservicename.wsdl --> https://webservice.web/webservicename?wsdl and it worked! – rasputino Jan 18 '17 at 09:57
  • 4
    Is this behavior explained/documented somewhere? – Doc Jan 23 '17 at 15:20
0

In my case, I got this error for adding a Hashtable as a parameter and it failed because it's not supported:

The type system.collections.hashtable is not supported because it implements IDictionary

IDictionary is not serializable, so in my case I switched to a simple array

Milana
  • 557
  • 9
  • 20