Question Web Service

Contissi

Member
Joined
Apr 16, 2012
Messages
5
Programming Experience
Beginner
First off I would just like you to know that I am new to C# and the Visual Studio environment in itself. I am a PHP programmer but have been volun-told to contribute to a work project involving C# and creating a web service. Beyond taking a few C programming classes in college, I have very little experience with the language.

I am trying to gain a better understanding of a web service in itself. We currently have created a new VS Project and added a web service file to it (ASMX). I have successfully connected to our Oracle DB and retrieved information from it. We have spoken with another business that has successfully created a web service similar to what we are attempting to create. They sent us some sample code from their project. They are using a WCF service. One of our vendors told us to start off with just creating an ASMX file instead of jumping into a WCF project. From what I read, WCF is like an ASMX service on steroids. I guess my question is whether or not it is easy to jump from an ASMX service to a WCF service? Is one better to use than another? When creating a WCF service, how do you test it? Using the ASMX, it lists out my public method and allows me to test the code within... When I attempted to create a WCF service and test it, it just gave me a page stating that I had created a service.

Really, any clarification anyone can provide would be greatly appreciated...

Thanks!
 
Microsoft would prefer you to use WCF. It is the way forward for .NET web services. There's really no point starting out using ASP.NET web services when you're basically going to have to move to WCF in the future anyway. VS provides a WCF test client, which will show you the methods exposed by your service and let you call them.

WCF Test Client (WcfTestClient.exe)
 
Good deal! Thank you! I do have another question. I have successfully connected to our Oracle DB using System.Data.OracleClient in our old ASMX service. When I attempt to add that reference to our new WCF service, it is not among the list of .NET references. Any ideas?
 
I believe that the Microsoft ADO.NET provider for Oracle was in the System.Data.dll assembly in earlier versions of .NET but it has since been deprecated and moved out into its own assembly. System.Data.dll is referenced by default in most project templates so you could use it without any extra steps, as you can Odbc, OleDb and SqlClient. If you want to use it in new projects you can, by referencing the appropriate assembly, but the reason it's deprecated is that Oracle have produced their own provider. That's a free download and adds significantly more functionality, so you should go with that instead.
 

Latest posts

Back
Top Bottom