views:

262

answers:

2

Hi, I am new to C# (2 days) and am trying to consume webservices. I have successfully compiled a sample script to access and consume the webservice. Tested it via a console app and it worked fine. I used wsdl.exe to compile and generate the proxy.cs file, then generated the exe with csc.exe.

Now I want to be able to call the script with paramters from a web form and am a bit lost. I have created a form based on C# where the parameters (user,pass) are typed in. When the submit button is pressed I want to call the webservice.

Do I need to compile the .cs into a DLL and the use it directly in my code? How would I do that?

Thanks for any help you can give me. Remember I come from PHP, so all this is VERY new to me!!!

BTW, whats the difference between wsdl.exe and svcutil.exe?

+1  A: 

You don't even need to use WSDL.exe, just create a web reference from the project you're consuming the web service from and you're good to go! After that you can basically use the webservice pretty much like any local library class. The web reference takes care of all the specifics.

Tommi Forsström
From the author's use of csc.exe, I somehow doubt he's using Visual Studio... =)
J. Steen
A: 

wsdl.exe writse WSDL for your Web Service classes, and proxy classes for your WSDL svcutil.exe does a wider range of things, but can generate proxies for WCF (Windows Communication Foundation) services. Perhaps svcutil could be thought of as the WCF version of wsdl.

C. Ross