I'm using .netTiers 2.3. I gened the DB and got the Web Services asmx file. It is great! But it's also 23,000 lines of code which makes VS2008 choke, spit and cough. I want to leave the initial asmx file alone and add web methods to a partial class of the service. The problem is that if I navigate to http://localhost/admin/ws/B2BFWServices.asmx, the webmethod in http://localhost/admin/ws/B2BFWServices2.asmx is missing and vice versa. I have tried eliminating the http://localhost/admin/ws/B2BFWServices2.asmx file and turning it into B2BFWServices2.cs. I have also tried removing the WebService Directives from the seconday file to no avail. Everything compiles fine, but the web methods are not shared across the partial class.
Sample code is below. If anyone can point out the errors of my ways, it would be greatly appreciated.
Paul
B2BFWServices:
"C#" Class="B2B.Website.B2BFWServices"-->"B2B.Entities"-->"B2B.Data"-->"B2B.Data.SqlClient"-->using B2B.Entities;
using B2B.Data;
using B2B.Data.SqlClient;
using System;
using System.Web;
using System.Web.Services; using System.Web.Services.Protocols;
using System.Data.Sql;
using System.Data.Common;
using System.Data;
using System.Configuration;
namespace B2B.Website
{
/// <summary>
/// Exposes CRUD webmethods for the B2BFWServices Database.
/// </summary>
[WebService(Namespace="http://localhost/B2BServices", Description="Exposes CRUD webmethods for the B2BFWServices Database.")]
public partial class B2BFWServices : WebService
{
[WebMethod(Description="Get rows from the table UserGroup, through the junction table UserXUserGroup.")]
public B2B.Entities.TList UserGroupProvider_GetByUserIdFromUserXuserGroup(int _userId, int start, int pageLength, out int count)
{
return B2B.Data.DataRepository.UserGroupProvider.GetByUserIdFromUserXuserGroup(_userId, start, pageLength, out count);
}
}
}
B2BFWServices2:
using B2B.Entities;
using B2B.Data;
using B2B.Data.SqlClient;
using System;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Data.Sql;
using System.Data.Common;
using System.Data;
using System.Configuration;
namespace B2B.Website
{
public partial class B2BFWServices : WebService
{
/// <summary>
/// Inserts an object into the datasource.
/// </summary>
/// <remarks>After inserting into the datasource, the object will be returned
/// to refelect any changes made by the datasource. (ie: identity columns)</remarks>
/// <returns>Returns true if operation is successful.</returns>
/// , System.Web.Services.Protocols.SoapRpcMethod
[WebMethod(Description = "Inserts a row in the table UserGroup.")]
public B2B.Entities.UserGroup UserGroupProvider_Insert(isoUsergroup grp)
{
B2B.Entities.UserGroup ug = new UserGroup();
ug.GroupName = grp.GroupName;
ug.GroupDesc = grp.GroupDesc;
ug.DivId = grp.DivID;
ug.SrsKey = grp.SRSKey;
B2B.Data.DataRepository.UserGroupProvider.Insert(ug);
return ug;
}
}
public class isoUsergroup
{
public string GroupName = string.Empty;
public Int32 UsergroupId = 0;
public string GroupDesc = string.Empty;
public string SRSKey = string.Empty;
public Int32 DivID;
}
}