Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6719769
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:07:55+00:00 2026-05-26T09:07:55+00:00

I created a SOAP service that is supposed to return a Category object and

  • 0

I created a SOAP service that is supposed to return a Category object and a CategoryCollection through a SubSonic query. The problem is that I can return a DataTable of data just fine, however the objects returned from the service are of active record type, internally, and not of my DAL entities.

For example when I consume the service, I see SOAPService.Category, but not SOAPService.CategoryCollection (I should be able to see SOAPService.[all other data entities], and the SOAPService.Category is of active record type, and doesn’t contain the actual Category properties.

Both classes defined through my SubSonic DAL generation.

 namespace TrainingWebService.DAL
 {
     /// <summary>
 // Strongly-typed collection for the Category class.
     /// </summary>
     [Serializable]
     public partial class CategoryCollection : ActiveList<Category, CategoryCollection>
     {  
     .
     .   
     .

and

/// <summary>
/// This is an ActiveRecord class which wraps the Categories table.
/// </summary>
[Serializable]
public partial class Category : ActiveRecord<Category>, IActiveRecord
{
.
.
.    

These classes exist in the TrainingWebService solution.

TrainingWebService.ISOAPService.cs:

using VRPCTrainingWebService.DAL;

namespace TrainingWebService {
// VRPC Training Web Service – Interface
[ServiceContract]
public interface ISOAPService
{

    [OperationContract]
    string GetDBConnectionStringDetails();

    [OperationContract]
    string ReturnSameString(string someString);


    //
    // Database-related
    //

    [OperationContract]                             // categories
    CategoryCollection GetAllCategories();          // SubSonic object

    [OperationContract]
    DataTable GetAllCategoriesAsDataTable();

    [OperationContract]
    DataTable GetCategoryAsDataTable(int id);

    [OperationContract]                             
    Category GetCategoryByID(int id);               // SubSonic object 

    [OperationContract]   
    // products
    ProductCollection GetAllProducts();

    [OperationContract]
    Product GetProductByID(int id);

    [OperationContract]                             // suppliers
    SupplierCollection GetAllSuppliers();

    [OperationContract]
    Supplier GetSupplierByID(int id);



}

}

In my SOAPService.cs

 public CategoryCollection GetAllCategories()            // get a collection of all categories
    {
        return DataCaller.GetAllCategories();
    }

    public DataTable GetAllCategoriesAsDataTable()
    {
        return DataCaller.GetCategoriesAsDataTable();
    }

    public DataTable GetCategoryAsDataTable(int id)
    {
        return DataCaller.GetCategoryAsDataTable(id);
    }


Here's a snip of the DataCaller code.

       /// <summary>
        /// Get all categories - returns a collection of categories
        /// </summary>
        /// <returns></returns>
        public static CategoryCollection GetAllCategories()
        {
            categoryCollection =
                DB.Select().From("Categories")
                    .ExecuteAsCollection<CategoryCollection>();

            return categoryCollection;
        }


        public static DataTable GetCategoryAsDataTable(int id)
        {
            try
            {
                dtResults = new Select()
                                .Where(Category.Columns.CategoryID).IsEqualTo(id)
                                .From(Category.Schema)
                                .ExecuteAsCollection<CategoryCollection>().ToDataTable();
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return dtResults;
        }

I think the problem may be in exposing the *.DAL entities through my web service, so they are accessible.

I have this working just fine in another solution I built a while back, but for some reason I can’t see what I’m missing here.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T09:07:55+00:00Added an answer on May 26, 2026 at 9:07 am

    Don’t forget to decorate your DAL entites with [DataContract], if applicable.

    DataContractAttribute Class

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've created an app that interacts with a SOAP service using java WS. I
I created a WCF SOAP service using VS 2008 that works server side. I
i created a WCf service with a method that can receive GET requests using
I have a SOAP service that returns an array of a complex type. The
I have a created web service that takes 2 complex types as parameters. I
I've created a simple SOAP web service using soaplib and run into an issue
I'm working on an application that uses Sudzc to interface with a SOAP web-service.
this is a weird thing. I created a simple SOAP based web service with
I have a web service that I created in C# and a test harness
I've got a simple C# web service proxy class that I created with WSDL.exe.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.