Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I determine why a webservice reference is being prevented from being added to my project in VS2008?

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?

like image 709
mezoid Avatar asked Jan 18 '09 23:01

mezoid


People also ask

How do I add a Web service Reference to a Web application?

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.

How do I add a Web service Reference in Visual Studio 2015?

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.

How do I add a service Reference in Visual Studio 2012?

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.


2 Answers

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

like image 79
Fabrizio Accatino Avatar answered Sep 22 '22 21:09

Fabrizio Accatino


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.

like image 38
mezoid Avatar answered Sep 24 '22 21:09

mezoid