I have a VS2005 project that contains a couple web service references. The project has recently been upgraded to VS2008 but now there is a problem with the web references...probably because they may not have been upgraded properly.
When I select Update Web Reference I get the following error:
"Value cannot be null. Parameter name: discoveryError % mexError" which is very helpful.
I've then deleted the web reference with the intent of re-adding it...
The Add Web Reference dialog comes up and successfully loads information about each of the methods associated with the web service.
However, I can't add the reference as the button to do so is grayed out and there is a text box titled "Web services found at this URL:" which contains the text "Operation is not valid due to the current state of the object".
Now finally, this brings me to my main question... How then do I add this web reference? Or better yet, how do I find out what is invalid about the "current state of the object"?
Has anyone had a similar experience in VS2008?
To add a Web Reference You can also open the Add Web Reference dialog box in the Solution Explorer pane by right-clicking References and selecting Add Web Reference. In the Web reference name box, rename the Web reference toExcelWebService. Click Add Reference to add a Web reference for the target Web service.
In Solution Explorer, right-click the name of the project to add the Web service to and then click Add Web Reference. The Add Web Reference dialog box is displayed. In the URL box, enter the URL of the Web service to use. If you do not know the URL, use the links in the browse pane to locate the Web service you want.
Open Microsoft Visual Studio. Open your project or create a new one. In the Solution Explorer right-click on YourSolution/YourProject/References. Select "Add Service Reference..." from the context menu.
I had the same issue on VS2010. In my case the problem was the proxy server. I got the wsdl from an external url. My solution: set the proxy in VS2010. Edit devenv.exe.config and add <defaultProxy>
under <system.net>
:
<system.net>
<defaultProxy enabled="true" useDefaultCredentials="true">
<proxy bypassonlocal="True" proxyaddress="http://yourproxyserver:port"/>
</defaultProxy>
</system.net>
If the proxy comes from a .pac file, you can omit the <proxy>
tag:
<system.net>
<defaultProxy enabled="true" useDefaultCredentials="true">
</defaultProxy>
</system.net>
An old post about a related issue:
http://fhtino.blogspot.it/2006/11/visual-studio-2005-proxy-problem-in-add.html
Finally figured it out.
I used WebService Studio to give me a better idea of what was going on. It came back with the error message "The request failed with HTTP status 407: Proxy Authentication Required".... which let me know that I had to install the new security certificate...the old one had expired.
I guess that answers this question about how to find more about what is invalid about the web service.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With