简体   繁体   English

如何部署3层WCF服务

[英]How do I deploy my 3 tier wcf service

I am new to deploying WCF projects so I would appreciate a little guidance on deploying the project. 我是部署WCF项目的新手,所以希望您能对部署该项目提供一些指导。

I have a VS2010 project that is using .NET 4 for the WCF service. 我有一个VS2010项目,正在将.NET 4用于WCF服务。

The WCF service accesses another project that I call the Data Access Layer (DAL). WCF服务访问另一个项目,我称之为数据访问层(DAL)。 The WCF service simply passes the Request XML on to the DAL. WCF服务只是将请求XML传递到DAL。

The DAL accesses a 3rd project that I use to communicate with SQL Server, dbConnection. DAL访问用于与SQL Server通信的第三个项目dbConnection。 dbConnection packages the information into a call to a stored procedure to be sent to a SQL Server. dbConnection将信息打包到对存储过程的调用中,该存储过程将被发送到SQL Server。 See the diagram below for a simple view. 请参见下图以获取简单视图。

在此处输入图片说明

So my first question is, how do I deploy the Data Access assembly. 所以我的第一个问题是,如何部署数据访问程序集。 I was thinking I put the assembly on its own server and then register it on that box. 我当时以为我将程序集放在自己的服务器上,然后在那个盒子上注册它。 And I would have a reference to the assembly's path in my WCF project. 我将在WCF项目中引用程序集的路径。

My 2nd question is, do I deploy the dbConnection assembly the same way? 我的第二个问题是,是否以相同的方式部署dbConnection程序集? Do I register it and the Data Access assembly has a reference to its path? 我是否要注册它,并且数据访问程序集具有对其路径的引用?

You decompose tiers wrong. 您将层分解错误。 If you think about 3 tier there will be: 如果您考虑三层,将会有:

1 - client pc that call your wcf service 2 - WCF service with its dataaccess layer 3 - SQl database. 1-调用您的wcf服务的客户端计算机2-具有其数据访问层的WCF服务3-SQl数据库。

在此处输入图片说明

If you want to speak about layered application, it is about application with n layers but this layers can be in one process. 如果您要谈论分层应用程序,那么它就是关于具有n层的应用程序,但是这些层可以在一个进程中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM