I have no experience on connectin开发者_运维技巧g web apps to a SQL server on a different machine through web services.
Are there standard web services that are supposed to be used?
Also, why wouldn't it be possible to connect to the SQL server on a "normal" way?
EDIT:
basically, I'm working on a new web application that needs a database. The client came back saying that they have a server but that it's only accessible by web services.
Hope that helps.
Thanks
EDIT 2: Thanks to all - I have a much better understanding ot f this now. I would mark all answers as good answers but the system only allows 1 : )
My take on this:
This sounds like the client does not allow connections to Sql Server the normal way, which is why they say you can only connect through a web service.
The web service would connect to the application the same way as a normal web application, but in this case (I'm guessing) they have the web service running on the Sql server box and then there is another server that hosts other web applications.
Some answers:
There are no standard web services that connect to Sql for you (unless you are using something like SharePoint - and even then they are limited). There are standards that you can use to make a web service that connects to a database, but in this case it sounds like the client has services for you to use.
Connecting a web application to a web service is not as difficult as it can seem. Look here. Essentially you consume the web service and then call the needed web method of the web service.
To connect to the service you are going to need to know it's URL. You should ask the client for information on consuming their web service (IE: the Location (URL), if a passcode or key is needed to connect, etc).
If anything needs to be clarified then let me know.
Hope this helps
The client came back saying that they have a server but that it's only accessible by web services.
This to me means that they have Web Services setup that your application will need to connect to and call into in order to access their database. In this case the "standard" web services are just the ones that the client provides.
If the client says you are going to need to use web services, well, that's just the way you are going to have to get at their data.
The reason they might only want to give access via web services is so they control what data you are able to change, and how. Also, it is rarely a bad thing to create an additional layer of abstraction between the database connection and the front end.
Will they be supplying said web services, or are you going to create them as well? If you are creating them, I would recommend reading up on WCF.
Edit: If you are writing the database, services, and front end, I would recommend looking into the repository pattern.
One of your comments said that they are only hosting the database.
You might want to clarify what they mean by "only connecting through web services".
Some hosts do not allow you to connect directly to a sql server with enterprise manager and instead force you to use a web based tool (that they also host) to do regular things like maintenance, DDL changes, etc. It's possible that this is what they mean.
However, you need to ask lots of questions here. Namely, what "web services" do they provide? How will you make DDL changes (table creation, modify columns, etc)? If you are the one that needs to write the service layer, where is it going to live and what other restrictions exist like port numbers and encryption mechanism?
If they are the ones that will make the DDL changes for you, what is their turn around time? Along with this, if you are the one writing the service layer, what is the mechanism for deploying an update?
精彩评论