Click here to Skip to main content
15,867,704 members
Articles / Web Development / IIS

Webservice sample - example of using SOAP protocol to access Internet Database Server

Rate me:
Please Sign up or sign in to vote.
4.76/5 (99 votes)
6 Jul 20072 min read 197K   10.5K   125   10
Use SOAP to communicate with a remote DB Server (Here I use SQL Server) on the Internet and get information or interact with the database

Introduction

I did this stuff more than 2 years ago and just wanted to share with "beginners" who are getting to know why webservice would be very useful when crossing the far distance and can be shared for many clients. This example shows you how to communicate with a DB Server on the Internet from a client application on your PC using SOAP protocol. Usually, Enterprise Information System (EIS) such as ERP, CRM, SCM are built for internal use purposes and installed on the LAN. We will use direct connection in that case and almost never have to care about the speed of the connection. But what happens if we implement an application with a DB Server on the Internet (maybe not EIS but a conference or online-meeting software for instance)? Can SOAP be one of the possible answers?

Screenshot - SoapDb.gif

Background

  • First, we create a Web service that can connect to the Database Server (here I use SQL Server), and query to return information or interact with records
  • Second, we create a Windows Forms client that can control the Web service and display the information or do whatever we want with the DB

Using the Code

You can find a full manual inside the ZIP file, together with a tutorial video. By the way, since this code was written long time ago, it's still in .NET 2003 and I'm not sure if it can run on .NET 2005 (after conversion). And I'm sorry if someone may ask for tungDbDriver.dll inside the ZIP file. I lost that assembly code and according to me, that DLL is very simple to write. And since the main purpose of this article is to give a tutorial on the advantage of webservice, please forgive me about it. Thanks.

Points of Interest

I consider the most interesting point to be the way we can establish connection with a "remote" database server on the Internet. Imagine that Yahoo or MSN Chat applications always require users to log-in first. When users key in the username and password, it sends a message to the server and checks to make sure that the user is in the database with the right password that has been provided by the user. I don't think they use SOAP protocol but Client/Server with messages sent between them are the way those applications communicate, similar to SOAP. There is "no direct connection" between the client application and the database server.

History

  • Written: 17 Oct 2005

Other Good Tutorials

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Team Leader
Vietnam Vietnam
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralMy vote of 1 Pin
InboundIT15-May-14 23:39
InboundIT15-May-14 23:39 
GeneralUseCurrentLocale... Pin
Sundeep Ganiga8-Nov-10 2:51
Sundeep Ganiga8-Nov-10 2:51 
GeneralMy vote of 1 Pin
khaanthienha9-Jan-10 2:33
khaanthienha9-Jan-10 2:33 
GeneralRe: My vote of 1 Pin
loirubuon21-Feb-10 22:25
loirubuon21-Feb-10 22:25 
Questioni want to add webservice in my project.,i want to make a dummy account in bank Pin
anithamol c.k1-Oct-09 6:25
anithamol c.k1-Oct-09 6:25 
GeneralI need to make a web service for shipping Rates Pin
atandon3-Dec-08 20:48
atandon3-Dec-08 20:48 
Generalwebservice may be using database Pin
atandon3-Dec-08 20:42
atandon3-Dec-08 20:42 
GeneralNice view on the subject..... Pin
Tom Leonard18-Jul-07 9:57
Tom Leonard18-Jul-07 9:57 
GeneraltungComponents.tungDbDriver source Pin
axuno11-Jul-07 12:11
axuno11-Jul-07 12:11 
GeneralRe: tungComponents.tungDbDriver source Pin
Nguyen-Thanh-Tung11-Jul-07 18:21
Nguyen-Thanh-Tung11-Jul-07 18:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.