C# Web Service to access from ASP.NET & desktop VC++

G

Guest

I want to develop some data access web services in C# that can be accessed
from both an ASP.NET web application as well as a VC++ desktop application.
i have used web services in the past from VC++ by using the WSDL file
provided by the web service.

We are migrating our application to the web but still want to be able to
access the SQL Server database using the same data access layer.

What is the best way to create the web service so that it can be easily
accessed from VC++ desktop app and still be able to leverage all the web
support built in for web presentation layer data access?

Regards

Rob C
 
L

Laurent Bugnion

Hi,

Rob said:
I want to develop some data access web services in C# that can be accessed
from both an ASP.NET web application as well as a VC++ desktop application.
i have used web services in the past from VC++ by using the WSDL file
provided by the web service.

We are migrating our application to the web but still want to be able to
access the SQL Server database using the same data access layer.

What is the best way to create the web service so that it can be easily
accessed from VC++ desktop app and still be able to leverage all the web
support built in for web presentation layer data access?

Regards

Rob C

Any web service created in Visual Studio with .NET will automatically
provide a WSDL file describing the interface. If your VC++ is able to
read the WSDL file and create the corresponding proxies, then you should
be fine.

You create a web service in .NET by creating a web service project (or a
web application project, and then adding a web service component), and
implementing public methods, marking them with the [WebMethod]
attribute. Just add a web service to your application, and it's pretty
well explained inside the file itself. There are things you can
optimize, but it's the basics.

Additionally, consuming a web service from a .NET application (also
ASP.NET application, server-side) is as easy as adding a web reference
to your web service (this will read the WSDL file and create the proxy)
and then use the created proxy (almost) as if it was a local class.
Almost because if the request is asynchronous (recommended), it's
slightly different.

If you want to consume the web service on the web client itself using
JavaScript, you should take a look to ASP.NET AJAX (ex codename ATLAS).

HTH,
Laurent
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top