我创建了一个SOAP服务,该服务本应通过分站式电解退回一个类物体和一个类孔。 问题是,我可以退还一份数据表,仅罚款,然而,从该处返回的物体在内部,而不是在我的DAL实体中具有积极的记录类型。
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], 以及 the SOAPService.Category is of active record type, 以及 doesn t contain the actual Category properties.
这两门课程都是通过我的慢性DAL一代确定的。
namespace TrainingWebService.DAL
{
/// <summary>
// Strongly-typed collection for the Category class.
/// </summary>
[Serializable]
public partial class CategoryCollection : ActiveList<Category, CategoryCollection>
{
.
.
.
以及
/// <summary>
/// This is an ActiveRecord class which wraps the Categories table.
/// </summary>
[Serializable]
public partial class Category : ActiveRecord<Category>, IActiveRecord
{
.
.
.
培训网服务解决方案中有这些课程。
培训网服务。
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); iii
iii
In my SOAPservice.cs
public CategoryCollection GetAllCategories() // get a collection of all categories
{
return DataCaller.GetAllCategories();
iii
public DataTable GetAllCategoriesAsDataTable()
{
return DataCaller.GetCategoriesAsDataTable();
iii
public DataTable GetCategoryAsDataTable(int id)
{
return DataCaller.GetCategoryAsDataTable(id);
iii
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;
iii
public static DataTable GetCategoryAsDataTable(int id)
{
try
{
dtResults = new Select()
.Where(Category.Columns.CategoryID).IsEqualTo(id)
.From(Category.Schema)
.ExecuteAsCollection<CategoryCollection>().ToDataTable();
iii
catch (Exception ex)
{
throw ex;
iii
return dtResults;
iii
我认为,这个问题可能在于通过我的网络服务揭露*.DAL实体,以便这些实体能够进入。
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.