Link to home
Start Free TrialLog in
Avatar of Luis N
Luis NFlag for Spain

asked on

vb.net using web service by proxy

Hi,

I need to use a web service in our vb.net windows form application.

I have:
- The Url of the web service .svc
- The .vb and .config file of the proxy

How can I start to use it?
Avatar of Ioannis Paraskevopoulos
Ioannis Paraskevopoulos
Flag of Greece image

Avatar of Luis N

ASKER

I'm sorry,  could you give me a direct example, I have a url, a dot .vb file and dot config file for proxy, but i Don't know what must i do with this files
If you are doing this for the first time, you need to go through a step by step procedure which is already mentioned in the below article.

http://www.evagoras.com/2011/02/09/creating-and-consuming-a-web-service-using-visual-studio-net/

Thanks,
Arun
Avatar of Luis N

ASKER

I know how can i use a web service, but in this case the autodiscover ?WDSL service is not published, then i can't do it like your example that said:

"In the dialog box that comes up, type in the complete URL of the Service Description of the Web Service, or the WSDL file. In our case, this file’s URL is http://www.xefteri.com/articles/nov182002/DegreesWebService/default.asmx?WSDL. VS will fetch the WSDL file, and if everything is fine, it will display it on the left, and enable the Add Reference button at the bottom, so we can add it to our Project. Click on the button to do so."

I have the proxy class in a .vb and .config files, how can i connect manually?

Regards
I'm not sure what you mean by 'connect manually'. I have a service that say, converts currency. Once I add the service reference to my project, I can call it as below.

Dim client As New CurrConvService.CurrencyConvertorSoapClient()
Dim conv As Double = client.ConversionRate(CurrConvService.Currency.USD, CurrConvService.Currency.INR)
Console.WriteLine(conv)

Open in new window


You will usually have a *SoapClient class that you can instantiate and call the web method to get the results.

Thanks,
Arun
Avatar of Luis N

ASKER

The question is that I can't add the service to my project directly because the autodiscover capability is not published.

Then, to use the service, the services developer send me a vb and config file (as proxy), but I'm not sure what i must to do with this two files

Regards
STUMPED!

Not sure what you are trying to achieve here. You said you have the url and the .vb and the config file for the proxy. Where are these files... in a Visual Studio project?

Add these two files to your project. See if the .vb file has a class named [something]SoapClient. You can then continue with something similar to the sample code I pasted earlier.

Also, if it does not violate security concerns, it would help if you can attach the .vb and .config files to this thread.

Arun
ASKER CERTIFIED SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
@@CodeCruiser.. a WCF service is still a web service.

Arun