Is there an update available for EntLib 3.0 CTP Validation Block?

Topics: General Discussion Forum
Feb 17, 2007 at 8:17 PM
The December release of the web services factory included a reference application that appeared to use an early version of the EntLib Validation block with WCF extensions. Is there an updated reference app or just the WCF extensions that are coded to the EntLib 3.0 Validation Block?

Regards

Don R.
Coordinator
Feb 19, 2007 at 9:22 AM
Hey Don, yes, the validation block that shipped with the Service Factory was an early version of the same validation block that is shipping in EntLib v3. The block in Service Factory is catered to message validation while the one in EntLib can potentially be used for other scenarios. There is no updated reference implementation or any plans to release one. If we hear that people would rather use the block that will ship with EntLib and they are finding it difficult to use in a message validation scenario, we will certainly consider putting together something that will help. Thanks,

Don
Coordinator
Feb 19, 2007 at 9:22 AM
Edited Feb 19, 2007 at 9:26 AM
Feb 19, 2007 at 1:34 PM
Thanks Don,

I think I'm just looking for the WCF VAB adapter, which I see from a note on another blog, should show up in the next release of the VAB. I can certainly wait on that.

Regards,

Don R.
Developer
Feb 19, 2007 at 4:30 PM
Don R,

You are right when you said that the WCF VAB adapter will fit your needs regarding the use of the EntLiv v3 VAB and WCF. As Tom said here (http://www.codeplex.com/entlib/Thread/View.aspx?ThreadId=6868) the WCF VAB adapter will follow the same pattern implemented in the WSSF message validation implementation (using the WCF infrastructure with behaviors and parameter inspectors) so if you can't wait for this adapter, you may replace the validation API included in WSSF and use the VAB instead. Changes should be pretty straightforward since the validation API in WSSF is a precursor of the VAB in EntLib v3. Feel free to post your questions and findings if you decide to tackle this task.

Thanks,
Charly.
Mar 1, 2007 at 9:08 PM
The WCF VAB adapter was included in last night's Enterprise library February update. It works beautifully. Also, the WCF Exception Shielding which seemed to only be only in the Service Factory reference model is now included too.

Thanks so much to the teams that have put this all together!

Don R.
Developer
Mar 6, 2007 at 1:45 AM
You're most welcome! The other WCF-related enhancement to EntLib 3.0 is in the Logging Application Block. We now have an EntLibLoggingProxyTraceListener which you can configure in your System.ServiceModel TraceSource to enable the Logging Application Block to process messages created by WCF. We also have a new XmlTraceListener which plugs into the block and generates output that can be understood by the WCF diagnostics tools (in EntLib 2.0 the XML gets garbled so the analysis tools don't work).

Tom
Jun 5, 2007 at 8:58 AM
I tried to use the validation library of the Enterprise Library 3.0 in a projets developed using the Service Factory ... without success!!

At first ,I supposed that the two libraries (Microsoft.Practices.Validation.Validators;
and Microsoft.Practices.EnterpriseLibrary.Validation.) could be interchangeble. So in the Message Contract Contract class I simply substitute, for example, Validator(typeof(LengthValidator), 0, 3 with StringLengthValidator(0, 3) without changing anything in the Service interface, as follows:

namespace logo.Service.ServiceContracts
{
MessageContract
public class SearchCentraliReq
{
private String descrizione;

MessageBodyMember(Order = 0)
DataMember(IsRequired = false, Name = "Descrizione", Order = 1)
// Validator(typeof(LengthValidator), 0, 3
StringLengthValidator(0, 3)
public String Descrizione
{
get { return descrizione; }
set { descrizione = value; }
}
}
}



namespace logo.Service.ServiceContracts
{
ServiceContract(Namespace = "http://logo.Services.ServiceContracts/2007/04", Name = "IService", SessionMode = SessionMode.Allowed)
ValidationBehavior
public interface IService
{

OperationContract(IsTerminating = false, IsInitiating = true, IsOneWay = false, AsyncPattern = false, Action = "SearchCentrali")
FaultContract(typeof(ValidationFault))
SearchCentraliResp SearchCentrali(Validator(typeof(InstanceValidator))SearchCentraliReq request);
}


Now, reading this thread, I realize that it should be used an adapter (in the Enterprise Library I see a EntLib3Src\App Blocks\Src\Validation\Integration\WCF library) but I didn't find any example how to apply that libray in my specific context.
Can anyone provide me some example or some link that can help me?

Kind regards
Enzo
Developer
Jun 5, 2007 at 3:59 PM
You will find useful info in this three part post:

Validating WCF Service Messages with Validation Application Block
Jun 7, 2007 at 11:29 PM
Edited Jun 13, 2007 at 11:25 PM
We're also using it in Service Factory 3.0 to allow for simple reconfiguration of model validation!

Ade