Click here to Skip to main content
15,902,894 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Can we use database in web services means can we connect database with web service? or we have to used database only with our web app and use with web services when web services called.
Posted
Comments
Sergey Alexandrovich Kryukov 28-Jan-16 2:30am    
Multi-tier.
—SA
Mohibur Rashid 28-Jan-16 3:32am    
agreed
Kishor-KW 28-Jan-16 4:16am    
web service is at the top here, right?
Sergey Alexandrovich Kryukov 28-Jan-16 9:04am    
No.
—SA

Yes, you can connect to a database via web services. But it depends on the db and you may have to write all the code yourself if an interface does not currently exist.
 
Share this answer
 
Top, bottom… what are you talking about? What options you may possibly have?

Let's say, you have a database server with a database. Let's say this is your back-end data tier. You can have another tier, running your WCF service. It can use different hosting (IIS, self-host…), different protocols — this is the whole idea behind WCF, but your application-layer protocol in on you, it can be expressed in the form your you WCF service contract. You can have many options here. Your contract can be close to the database semantics, or it can abstract out functional detail of your particular database service and present some more generalized database model. Or it can reflect just the semantics of your application. Or you can combine those approaches. And you can have more than one WCF service. Your service application should play the role of the WCF and, from the other hand, should act as a client of your database.

And then you can have anything else you need, but the idea is: your other tier(s) will communicate to the database only through your WCF tier.

Please see: Multitier architecture - Wikipedia, the free encyclopedia[^].

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900