CSLA .NET

From Rockford Lhotka's Expert C# 2008 and VB 2008 Business Objects books

Building a web service for consumption - receiving "batch" data from 3rd party

rated by 0 users
This post has 3 Replies | 0 Followers

Not Ranked
Posts 7
jscontreras Posted: Sun, Jan 11 2009 3:07 PM
Hi,
I'm currently designing a web service for our 3rd party providers.  They want to be able to pass some type of object containing data about customers into our CRM system.

The Design
Process Flow
3rd Passes new data (via webservice) -> webservice receives data object -> webservices calls the Facade which passes the data object to a Business Object -> the Business Object calls the DAO to insert the new data

The data object being passed in the web service is a container for customer information
[FirstName
LastName
Age
Address
City
State
Zip]
Can have one or more records.

Questions/Comments:
1. I want to use the CLSA Framework to accomplish, can I use the CLSA to accomplish this design
2. I've use Web Services but only internally - I'm a novice using web services externally how can do I this, any samples would be great

Thanks,
Joe


Top 10 Contributor
Posts 520

Absolutely.  Your CSLA business objects will sit behind the service interface.  Take a look at the Web Service Interface chapter in the book and the ProjectTracker sample app for example code.

In its simplest form, you'd have a CustomerList that contains Customer business objects.  Your service would "translate" the CustomerInfo data transfer objects (DTO) passed into the service method to Customer objects and populate the CustomerList then call the Save method on the list class.  It really is that simple.

Hope that helps.

Not Ranked
Posts 7
I've design a customer object and reviewed the Sample Web Service in Project Tracker.  In the Add Project Web Method it only adds one project at a time.  What I'm trying to figure out is if my client sends a bundle of customer information how can I handle that specifically?

Would it be something below.  I'm not sure how to handle via a webservice.

[Web Method]
  [System.Xml.Serialization.XmlInclude(typeof(User))]
    
public  ArrayList LoadUsers()
    {
        User user = 
new User();
        
return user.LoadAllUsers();
    }

Not Ranked
Posts 7
Ignore Previous Post it was sent by accident.  I would like to do something like below
[Web Method]
public IList<Customer> LoadCustomers(IList CustomerList)
{
    CustomerFacade facade = new CustomerFacade();
    facade.LoadCustomers(CustomerList);
}


LoadCustomers would expose the BO --> DTO behnind the scenes.  Is this possible within the Framework.

Thanks
Page 1 of 1 (4 items) | RSS

Please contact Magenic for your .NET consulting
and CSLA .NET mentoring needs.
Please consider making a donation to help support the ongoing development of CSLA .NET.

Make donation through PayPal - it's fast, free and secure!
Why donate?
Copyright (c) 2006-2010 Marimer LLC. All rights reserved.
Email admin@lhotka.net for support.
Powered by Community Server (Non-Commercial Edition), by Telligent Systems