WCF / ASMX :: Design A Web Service Layer On Top Of Db For Data Integration?

Dec 22, 2010

We're doing a data integration project between a MS Sql Server database and a Microsoft CRM system (through its web services).

We're trying to build a "service" layer on top of the database. The design of our current solution is to use web services for CRUD, with xml being the format of data.

Views are created to consolidate related tables into one entity, and we query these views, using the "SELECT * FROM someview " + "For XML" to generated xml that will be returned from our web services.

For update we're trying to use the same approach - using SQL XML to map updates views, we have "instead of" triggers defined on top of these views, and in these "instead of" triggers we update the underlying tables.

The views/triggers are generated by tools so don't be too concerned with coding efficiency here...

what do you think if we use WCF data Provider to publish a enterprise data model (essentially DTOs) ? p.s., we don't have a BL layer for now, it's all in the stored procedures!!!

What's your opinion on this / any better design?

View 4 Replies


Similar Messages:

C# - N-layer Business/service Layer Design?

Jan 26, 2011

I'm trying to reevaluate our n-layer architecture and would love to get some based on your experiences. Here is our typical .NET n-layer (sometimes n-tier) design.

Project.UI
Project.Services
Project.Business
Project.Model
Project.DataAccess

DataAccess typically consists of Entity Framework 4 and Repository classes. I attempt to follow the Aggregate Root concept in order to avoid having a repository for table, easier said than done in my experience. I tend to have ~70% match between Repositories and Tables.

Model usually consists of my Entity Framework 4 entities, I've been using Self-Tracking EF entities with success.

Business is what I struggle with the most. I typically have a Manager class for every Repository. This class will contain methods like .Add() which will perform business validation before forwarding down to repository.Add().

Services, typically I will only implement this if in fact I am looking to create a web service based solution. This layer will be tasked with marshaling requests/responses between DTOs and entities. And most importantly provide the more coarse grained interface. For example a TradingService.SubmitTrade(), which is really a facade for a business transaction which might include AccountManager.ValidateCash(), OrderManager.SubmitOrder(), etc.

My business layer is very entity centric, really it's just the glue between the entities and the repository, with validation in between. I've seen many designs where the Service Layer is what holds a reference to the repositories (in essence skipping the "business layer"). In essence it serves the same purpose as my Business layer, it does the validation, however its' responsibility (and naming) is a higher level, more coarse grained business transaction. Using the example above the TradingService.submitTrade() will not delegate to any business manager classes, it would itself query the necessary repositories, perform all the validation etc.

I like my design in a sense that I can reuse a business layer method in multiple service calls, however I hate the fact that for every repository I have a matching business layer manager, creating tons of extra work. Maybe the solution is a different type of grouping at the Business Layer level? For example combine individual Manager classes like PhoneManager and EmailManager (note I have Phone entities and Email entities) into a logical Manager class such as ContactsManager (note I don't have a "Contact" entity type). With methods such as ContactManager.GetPhones() and ContactManager.GetEmail(), etc.

View 1 Replies

WCF / ASMX :: First Data Web Service API Integration

Jan 27, 2011

I'm trying to use the First Data Global Gateway web service API. I was able to reverence the WSDL file in VS and get the classes to show up. I get the error "Object reference not set to an instance of an object." I can't figure out what I'm doing wrong.

[Code]....

View 8 Replies

Architecture :: How The Data Pass From One Layer To Another Layer In Mvc Design Pattern

Apr 1, 2010

how the data pass from one layer to another layer in mvc design pattern...

View 2 Replies

MVP - Presenter And The Service Layer - Where To Declare Service Layer

Mar 27, 2011

I'm reading through Architecting Microsoft .Net Solutions for the Enterprise and I try to figure a couple of things out concerning the Presenter and the Service Layer.

First off, my Presenter needs to call methods that reside in the Service Layer, like initialize(), save() etc. But where do I place a reference to the service layer? Should it be at class level in the Presenter, or should I define a new service in the presenter methods itself?

Second - this isn't really clear in the book either - is this how the processing from the Presenter to the Service Layer works?:

[code]....

View 1 Replies

Business Layer Errors And Service Layer Handling?

Mar 7, 2011

We're building a large web app that has numerous layers. In order to communicate to the business layer we're using a service layer that the web layer calls when data is needed. Unfortunately, it seems that if exceptions are thrown in the business layer, it seems that the services on the web side are wrapping the exceptions and re-throwing them. We're looking for a clear way to encapsulate the error and log it, without WCF wrapping a new exception around the original.

View 2 Replies

Architecture :: Should The Unit Of Work Point To The Service Layer Or The Repository And Then The Repository Point To The Service Layer

Jan 26, 2011

Just wondering, in an ASP.NET MVC3 environnement with entity framework. Should the Unit of Work point to the service layer or the repository (and then the repository point to the service layer) ?

Ive saw two example:

* One where the unit of work and repository both have an instance to the service layer..

Link: Entity Framework 4 CTP 4 / CTP 5 Generic Repository Pattern and Unit Testable

Doesn't use a service layer but its obvious that one could be use in that case.

* Second where the unit of work have an instance to the repository which have an instance to the service layer..

[URL]

What would be better ?

View 11 Replies

Architecture :: Design For Easy Integration Into Customers Websites?

Aug 22, 2010

The project, once done, will provide a "portal" into a limited portion of the client's database. All clients are using a SQL database, but various server software products are involved (MSSQL, MySQL, and others).

My question, however, has more to do with the "look and feel" of the finished product. We want to be able to integrate our 'portal' easily into the client's websites and have it look as seamless as possible. Obviously, placements of logos, etc. -- but also colors, fonts, etc.

Client sites tend to be simplistic in design. We envision the customer placing a link to our site from theirs, and our site will be running on IIS on their server. At least that's the plan.

The goal right now would be to make as much of this "parameter driven" as possible, so that a lot of the install can be accomplished through some simple settings, isolated in one or two files such that at installation time we can tweak those settings and be up-and-running in a short period of time with a site that integrates reasonably well with the customer's.

But I'm uncertain as to whether there is a better approach. Obviously, we could try to redesign our site with each install with the basic design of the customer's, but this would be cost-prohibitive in some situations. So, I'm thinking about a "second best" alternative that may be adequate in most circumstances.

View 1 Replies

.net - Data Access Layer As A Web Service?

Aug 18, 2010

I have been researching for a while and have actually created a prototype ASP.NET web service as a DAL for a few ASP.NET 2.0 web sites. Just would like to ask for some insight/advice from more experienced developers out there who had successfully rolled out DAL as a web service. What are the drawbacks/risks to deploying DAL as a web service? What is the best way to secure or authenticate consumption of this web service? WCF is out of the question, I'll be coding in VS 2005.

View 4 Replies

MVC :: Data Annotations Or Service Layer Validation?

Feb 10, 2010

I'm creating a Asp.Net MVC application and I need help on whether I should chose Data Annotations or Service Layer Validation (e.g. if(Model.Name.Trim().Length == 0)?

View 5 Replies

Calling Cached Data (in Service Layer) From A MVC View?

Jul 22, 2010

We are adding tooltips to our ASP.NET MVC product, and we are getting the text from our database (technically, from a cached copy of the data). To do so, we created an Html Helper method:

<%=Html.Tooltip(Model.GetTooltipText(Tooltips.ClientPage.StartDateId))%>

The GetTooltipText method is in our BaseViewModel, and simply uses the passed in Id to fetch the tooltip from cache. Would this be considered a bad design? What other alternatives would we have?

View 1 Replies

WCF / ASMX :: Integration With Java?

Feb 17, 2011

Please help me how to use WCF Service in Java application.

View 3 Replies

WCF / ASMX :: Starting Integration With Web Services?

Mar 25, 2010

I'm having my first experience with Web Services with .Net. I received from a client an integration manual to consume a web service they have.

In this manual I have the following information:

Request Interface: [URL]

Using SOAP request would return a XML Document with the response.

WSDL: [URL]

Request XML:

[Code]....

There's also XSD for the response XML.

Well, I'm having a little trouble trying to figure out how to consume this web service.

I found a topic here pointing to a MSDN article. There it says that I would have to add a Web Reference for this web service, but in my case this web service is external. Do I really have to add this reference to consume the web service? If yes how do I do that?

Next I have to create the XML Document that will be sent with the SOAP request. But here's a question. Searching on the internet I found mainly two types of request XML. I don't know wich one I should use.

The first one would be:

[Code]....

The second one is a XML file with soap:Body, soap:Header, soap:Envelope, etc.

Wich one should I create with my application in order to consume the web service? If it's the second one, how would look the XML for the data of the first XML?

And finally, how do I send the Soap request? As I said above, I found a MSDN article but it assumes I'm adding a web reference to the web service on my project and I belive that in my case I won't add this reference. So, how do I consume this web service?

I'm kind of lost here and really really soon I will have to estimate how long will take to develop the web service consume code.

View 3 Replies

Architecture :: How To Pass The Data Between Data Access Layer And Business Acces Layer

Jun 3, 2010

here i have in 3-tier architecture , how to pass the data between DAL and BAL. i am using grid view to edit the data,when ever i click on the edit button all the corresponding fields should come to textboxes. i tried for delete ,it works fine bt not working to EDIT.

View 7 Replies

Architecture :: Data Access Layer And Business Logic Layer?

Jun 24, 2010

I am building a web site following the tutorials on asp.net. I am using dataset as data access lay, and writing classes to access the dataset. But the example is just basic ideas, how do I retrieve individual table column value in the business layer?For example, if I have a table called Product, I only want to find out what is the product name by product id. I did this in my ProductBLL:

public ProductBLL
{
public int GetProductName(string productId)
{
ProductDataSet.ProductDataTable prodData = Adapter.GetProductById(productId);
[code]...

Is there a better way, or am I doing this correctly? Can anybody give me a reference to a more complicated business logic model?

View 16 Replies

C# - Software Design & Web Service Design

Dec 30, 2010

I'm about to design my Web service API, most of the functions of my API is basically very simular to my web application. Now the question is, should I create 1 single method and reuse them for both the web application and the web service api? (This seems to be the logical solution, however its very complicated; it's much easier to duplicate the method used by the web application, and keep both separate, ie one method for the web application and one method for the web service.)

1) REUSE: one main method and reuse them for both web application and web service application (I like this but it's complicated)

WebAppMethodX --uses-->
COMMONFUNCTIONMETHOD_X
APIMethodX ---uses---->
COMMONFUNCTIONMETHOD_X
ie Commonfunctionmethod_x contains reusable set of common features
PRO: less code, less maintenance, less bugs.
CON: very complicated

2) DUPLICATE: two methods, one method for the web application and one method for the web service.

WebAppMethodX
APIMethodX
PRO: simple
CON: duplication = more code, more maintenance, more bugs!

View 4 Replies

MVC :: Service Layer Validation

Feb 24, 2010

I was going through the MVC samples regarding validation at the service layer and I have a question and probably a dumb question at that.
If you have the item below, the data is already in the product object and this is fine if you are expecting mappings with the correct data types, however presuming UnitsInStock is an Int, then if the user had typed in "banana," and considering that nothing has been validated on the server side at this point, then the app would have failed as soon as you tried to insert "banana" into UnitsInStock when the form returned from wherever at the controller layer.

protected bool ValidateProduct(Product productToValidate)
{
if (productToValidate.Name.Trim().Length == 0)[code]....

So my question is...is there a tricksy way (or best practice way) of dealing with this or do you have to use a "dirtyProduct" all strings object that you validate at the service layer and which returns a clean "Product" object if is "isValid" that can be passed into the repository?

View 4 Replies

Should The Unit Of Work By Used By The Service Layer Or The Repository

Jan 26, 2011

In an ASP.NET MVC3 environnement with entity framework. Should the Unit of Work point to the service layer or the repository (and then the repository point to the service layer) ?

Ive saw two example:

* One where the unit of work and repository both have an instance to the service layer..

Link: Entity Framework 4 CTP 4 / CTP 5 Generic Repository Pattern and Unit Testable

Doesn't use a service layer but its obvious that one could be use in that case.

* Second where the unit of work have an instance to the repository which have an instance to the service layer..

[URL]

View 16 Replies

MVC :: Passing Values From Controller To Service Layer?

Mar 24, 2011

I am working on Tenant module that has to display following fileds, Tenant Id, Tenant Desc, Contact Person, Contact Phone. In the DB, these are designed as two separate tables - Tenant and Contact. Tenant table has Tenant Id, tenant Desc and Contact Id . Contact table has all the contact related properties. I am using EF as DAL.

To make my system loosely coupled, I have created a repository pattern to talk to EF entities. Also, for validation I am using service layer.

My repository layer has two interfaces and classes corresponding to Tenant and Contact.

public interface ITenantRepository : IRepository<Tenant> // IRepository<T> is a generic interface for CRUD operations
{
Tenant Get(int id);
IEnumerable<Tenanr> List() ;

[Code]....

View 4 Replies

Designing System With Presentation Layer And Web Service Based API

Oct 19, 2010

We are designing a system that has functionality that is essentially the same at the presentation layer and the exposed API layer. My question is what technique / strategy to use so we can get the most reuse out of our code with performance in mind? Here's a simplified example: A user can add a Customer via a web form. This will fire the Customer.Create() method. An API consumer / user can add a Customer via a SOAP / HTTP-POST to a web service which will call the Customer.Create() method.

Imagine these layers:
PRESENTATION
|
|
WEB SERVICE API (Customer.Create() is available here
|
|
FACADE Business Object Interface - Customer.Create() signature is here
|
|
BUSINESS Business object - Customer.Create method() is fleshed out here
|
|
DATA ACCESS - Writes data

The presentation layer SOAP calls the Create() web method, which calls the facade's Create() method which calls the business object's Create() method which wires via the data access layer.

Questions:

Is there a concern about performance in using the API's web services in our presentation layer, or are there alternatives to connect the presentation layer directly to the facade? If so, what technology to use (WCF, Remoting, Web Services, etc)?

View 2 Replies

WCF / ASMX :: Get Data XML From Web Service

May 18, 2010

I´m new to web services and currently working with an integration to a third party system. I have created a web service that creates and exports a <List> of objects. The challange I have is that the third party company consuming my created web service wants to have the data as a XML document just as it is presented when I push the "Invoke button" when testing my web service on the server it resides on. Doing so I get all my exported data presented as a nice XML document. Since a web service actually exports this XML it should be a fairly simple task, but I do not know how? Would perhaps anyone have a code snippet consuming a web service and present the data just as an XML document? Or could point me to an example? I´m using VS 2008.

View 3 Replies

WCF / ASMX :: Create Web Service - How To Web Page Call Sales_Services.asmx

May 5, 2010

if i have the web application with many pages like add order page, edit order page, and delete order page actually they also interact with the Sql Server 2008 and i also create web service page call Sales_Service.asmx. i know just i need to put something like query into Web Method in Sales_Service.asmx but i have a lot of queries, i don't know which query i should put into it and how the web page call the Sales_Services.asmx

View 2 Replies

WCF / ASMX :: IIS Memory Increasing For Each Client Request In Asmx Web Service?

Nov 8, 2010

A customer reported that our asmx web service is continually increasing in memory (mem usage as well as private bytes). We are able to reproduce the problem in our lab with Windows 2003 Server SP2 (fully patched) on some of the machines. The customer is using Windows 2008.

We created a Hello World web service targeting the 2.0 framework built under VS2005 SP1 and a test client that continues to call it. The memory increases steadily - approximately 40K per client request. If the test app is paused, the memory remains the same. When it is closed, the memory drops. Explicit calling of GC.Collect does not drop the memory.

We have run the memory profiler on the service and the leak is all native memory. We have uninstalled/re-installed the Framework on one of the machines but no difference. To our knowledge all of the security and IIS settings are not modified. We have compared app pool, default web site and virtual directory properties to machines that have no problem and they are identical.

View 11 Replies

WCF / ASMX :: How To Call Asmx Web Service In A .net App From Classic Asp App Js File

Mar 17, 2011

I have a .net app developed in .net 4.0 version. And I implemented an asmx web service in this. Now I want to call one of the webservice method in another classis ASP application java script function.

View 2 Replies

WCF / ASMX :: Running A Web Service User Service / Domain Account?

Mar 28, 2011

Is it possible to run a web service as a particular user/service account in the same way a Windows service can?I have a service account used for connecting to the DB and want to run the webservice under this account as the users using the webservice won't have DB access.The way I see to do it is to include the Impersonate option in the Web.config file, but is there any better way to do this?

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved