Data Portal Channel RemotingData Portal Channel Remoting
Old forum URL: forums.lhotka.net/forums/t/6709.aspx
Jashvanthi posted on Wednesday, April 01, 2009
Hi All,
I am using the CSLA in one of my project..i want to implement the remoting using Dataportal channel. i am new to the remoting.can you please suggest me how to implement the remoting using Dataportal channel with just making the configuration changes.
Regards,
Jash
RockfordLhotka replied on Wednesday, April 01, 2009
This is explained in the Expert 2005 Business Objects book, most completely in Chapter 12, and in other chapters as well.
If you are using current versions of .NET and CSLA .NET (anything in the past 2-3 years), then I'd suggest you consider using WCF instead. Configuring the data portal for WCF is covered in Expert 2008 Business Objects and in the Using CSLA .NET 3.0 ebook.
Jashvanthi replied on Thursday, April 02, 2009
Thanks Rocky..
i found one solution in a thread given http://forums.lhotka.net/forums/thread/7228.aspx .I have doubt in that thread whether the connection string should be given in the Wcf server project .Then if i use the CslaAuthentication as 'Csla' it is showing me error with some BusinessPrincipals
Regards,
Jash
RockfordLhotka replied on Thursday, April 02, 2009
CslaAuthentication must be the same on client and server.
If CslaAuthentication is "Csla" then the client must set a valid principal before making any data portal calls. A valid principal can still be unauthenticated, but must be Serializable, and prior to CSLA .NET 3.6 it must inherit from Csla.Security.BusinessPrincipalBase. Starting in version 3.6 the principal is only required to be Serializable.
Jashvanthi replied on Friday, April 03, 2009
Hi Rocky,
Thanks for your help.Somehow i was able to implement the remoting using WCF Dataportal channel.In one scenario,I m using a normal dataportal fetch method with criteria object.But i am getting a error as 'The underlying connection was closed: The connection was closed unexpectedly.'.I donno the reason but i am sure that i ve given a proper Dataportal_Fetch method with criteria object.My code is
public static DataTable GetPaymentRollbackList(string userInitials, int invoiceNumber)
{
return DataPortal.Fetch<Admin>(new Criteria(userInitials, invoiceNumber)).Results;
}
#region Criteria
[Serializable()]
private class Criteria:CriteriaBase
{
public string UserInitials ;
public int PaymentID;
public int InvoiceNumber ;
public Criteria(string suserInitials, int invoiceNumber)
: base(typeof(Admin))
{
UserInitials = suserInitials;
InvoiceNumber = invoiceNumber;
}
public Criteria(int iPaymentID)
: base(typeof(Admin))
{
PaymentID = iPaymentID;
}
}
#endregion
private void DataPortal_Fetch(Criteria criteria)
{
using (SqlConnection conn = new SqlConnection(DataAccess.NewConnection))
{
conn.Open();
using (SqlCommand command = conn.CreateCommand())
{
command.CommandType = CommandType.StoredProcedure;
command.CommandText = "up_ACCTAdminPaymentList";
command.Parameters.Add("@UserInitials", SqlDbType.VarChar, 5);
command.Parameters["@UserInitials"].Value = criteria.UserInitials;
command.Parameters.Add("@InvoiceNumber", SqlDbType.Int);
command.Parameters["@InvoiceNumber"].Value = criteria.InvoiceNumber;
using (SafeDataReader safeDataReader = new SafeDataReader(command.ExecuteReader()))
{
_results = DataAccess.ConvertDataReaderToDataTable(safeDataReader,"");
}
}
MarkOld();
}
}
Sorry for pasting all the code..this is the functionality i m implementing in remoting..please can you help in solving this issue...this issue is irritating me from the morning.please help
Thanks,
Jash
Copyright (c) Marimer LLC