Question

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

Was it helpful?

Solution 2

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

OTHER TIPS

The following solved my problem:

http://social.msdn.microsoft.com/Forums/zh/wcf/thread/02ce9fb9-6f67-45ec-9668-2dcd2317aab0

If you are behind firewall you need to make Visual Studio use the system proxy settings which can be done by manipulating your devenv.exe.config file.

Open it in Visual Studio and alter the section as below:

<system.net>
    <defaultProxy useDefaultCredentials="true" enabled="true">
        <proxy usesystemdefault="True" proxyaddress="http://yourproxyserver:port" bypassonlocal="False"/>
    </defaultProxy>
    <settings>
        <servicePointManager expect100Continue="false" />
        <ipv6 enabled="true"/>
    </settings>
</system.net>

i used target framework as 3.5 and i din't face any issue adding the webreference i would suggest retry the steps you followed

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top