CSLA .NET

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

Welcome to CSLA .NET Sign in | Join | Help
in Search

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

Last post 01-18-2009, 7:40 AM by jscontreras. 3 replies.
Sort Posts: Previous Next
  •  01-11-2009, 3:07 PM 29690

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

    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


  •  01-11-2009, 8:08 PM 29693 in reply to 29690

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

    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.

  •  01-17-2009, 6:30 PM 29949 in reply to 29693

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

    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();
        }

  •  01-18-2009, 7:40 AM 29951 in reply to 29949

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

    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
View as RSS news feed in XML

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?
Powered by Community Server, by Telligent Systems