Connecting Tech Pros Worldwide Forums | Help | Site Map

Using a web service in Visual Studio 2003

Newbie
 
Join Date: Jul 2009
Posts: 9
#1: Jul 3 '09
Hi,

I am new to web services but I have been asked to connect to an external web service through Visual Studio 2003.

The problem that I have is that the company who developed the web service have not and will not publish their WSDL online and the web service is in the form of a .svc file.

The other problem is that I have to go through a proxy server for external access.

I have created a new console app in VS2003 and tried to add a web reference pointing to the url of the .svc file but I get an error:

The proxy settings on this computer are not configured correctly for web discovery. Click the Help button for more information.

I think that I need to configure my proxy settings in some way.

Please could someone give me some advice on how I connect and use this web service which is in the format of a .svc file.

Thanks in advance

Gary

Newbie
 
Join Date: Jul 2009
Posts: 9
#2: Jul 3 '09

re: Using a web service in Visual Studio 2003


Hi,

In a console app, I am trying to add a web reference to an external web service in Visual Studio 2003. The web service that I am trying to connect to is a .svc file and we connect through a proxy.

When I enter the URL and click Go in the Add Web reference screen in VS2003, I get an error which reads:-

There was an error downloading 'http://............dummyws1.svc'.

The request failed with HTTP status 400: Bad Request.


I believe this is because of the http version that we are running, how do I change it for this request to the web service?

Thanks in advance
Gary
insertAlias's Avatar
Forum Leader
 
Join Date: Apr 2008
Location: San Antonio, TX (USA)
Posts: 2,608
#3: Jul 3 '09

re: Using a web service in Visual Studio 2003


Hmm, did clicking the help button give you any useful advice?
Newbie
 
Join Date: Jul 2009
Posts: 4
#4: Jul 3 '09

re: Using a web service in Visual Studio 2003


You may need to provide the proxy connection in the creation of the service object as described in this article:

http://www.codeproject.com/KB/webser...xy.aspx?df=100

Extracted code:

Expand|Select|Wrap|Line Numbers
  1. Dim service As New YourService.Class
  2. Dim credentials As New System.Net.NetworkCredential("username", "password", "domain") 
  3. Dim proxy As New System.Net.WebProxy("10.0.0.1", 80) 
  4. service.Proxy = proxy
  5.  
Hope that is relevant.
Cheers,
Scott
Newbie
 
Join Date: Jul 2009
Posts: 9
#5: Jul 7 '09

re: Using a web service in Visual Studio 2003


Hi,

In a console app, I am trying to add a web reference to an external web service in Visual Studio 2003. The web service that I am trying to connect to is a .svc file and we connect through a proxy.

When I enter the URL and click Go in the Add Web reference screen in VS2003, I get an error which reads:-

There was an error downloading 'http://............dummyws1.svc'.

The request failed with HTTP status 400: Bad Request.


Does anyone have any ideas what might be causing this. I got the same error when trying to connect to this web service using SoapUI, but got it resolved by changing the http version from 0.9 to 1.1 within SoapUI.

Could this be the same problem? How do I correct this in VS2003?

Thanks in advance
Gary
Reply

Tags
proxy settings, svc, web service