Search code examples
visual-studiosharepointweb-reference

Adding a web reference in Visual Studio 2010 to point to a Sharepoint 2007 site


I'm building a console application that can load a content type and remove the seal on it through C#. In attempting to add a web reference to the application, I'm getting an error which is strange because I use the same web reference in another application and it works fine. I'm pretty sure I hit this problem before and fixed it, but I cannot remember how :(

My steps:

  1. Right-click project and click Add Service Reference...
  2. Click Advanced... button
  3. Click Add Web Reference... (I receive the same error when attempting to add this as a Service Reference instead)
  4. Paste URL in text box: http://(domain)/videolibrary/_vti_bin/lists.asmx and press Enter
  5. The box on the left side shows all my service operations, but the box to give the web reference a name and the Add Reference button are grayed-out and the following error is shown above:

There was an error downloading 'http://(domain)/videolibrary/_vti_bin/lists.asmx'. Unable to connect to the remote server No connection could be made because the target machine actively refused it 127.0.0.1:80 Metadata contains a reference that cannot be resolved: 'http://(domain)/videolibrary/_vti_bin/lists.asmx'. There was no endpoint listening at http://(domain)/videolibrary/_vti_bin/lists.asmx that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details. Unable to connect to the remote server No connection could be made because the target machine actively refused it 127.0.0.1:80 If the service is defined in the current solution, try building the solution and adding the service reference again.

EDIT: Tried changing Target Framework from .NET Framework 4 Client Profile to .NET Framework 3.5 to no avail


Solution

  • I tried it from a VM and it worked fine. Go figure. Must be something with my outgoing proxy settings.