Managing exceptions on EDRA - quick tip
September 28th, 2004
The exceptions thrown by business actions in EDRA are caught by the corresponding adapters (either a generic Exception or a BusinessRuleException). In the case of the WebServiceInterfaceAdapter, it will catch BusinessRuleException’s and Exception’s and will generate a SoapException and with the exception information in its details node.
This way the client will always see a SoapException (in the case of webservices) or an ApplicationException (in the case of remoting).
The idea is to get the SoapException on the client and make use of it.
This piece of code will clarify it.
try {
// call EDRA service
}
catch ( SoapException se ) {
if ( se.Code == SoapException.ClientFaultCode ) {
// this is a BusinessRuleException. Show it to the client
lblBizRuleBroken.Text = GetDetails( se.Detail );
} else {
// this is an Exception, a server fault, user normally don’t want to see it
// Show a generic message and the reference code. The reference code is in the Detail XmlNode of the se
}
}
Validation in EDRA
September 28th, 2004
“A business action can provide a semantic input validation method (see the validationMethod attribute in the BusinessAction configuration). If requested in the configuration file, the method is called by the business action pipeline target before the service implementation method is called. The method is given the input data as argument(s) and should raise an exception if the date is not valid. If an exception is raised, the service implementation method is not called.“
To implement it you would have to
- Write another method it in your BA class (the name is arbitrary)
- Put these attribute as part of the in the configuration file.
validate=”true”
validationMethod=”ValidateFunds”
- The method will receive the same request that your BA method
- If the data doesn’t validate throw a BusinessRuleException
EDRA also gives you a method to do syntactic validation of the message.
The syntactic validation is implemented with a handler, and it will validate the request/response message with a XML schema (xsd).
<ra:handler ra:handlerName=“SyntacticValidation”>
<ra:syntactValidationSettings ra:requestSchema=“C:\Projects\Test\Schemas\FundsTransferRequest.xsd” ra:responseSchema=“”/>
“This can be used whenever you need to validate the structure of messages. This would typically be used with public services that can be called by any external client.
With public services, you do not have control over the requester. Another reason for using this handler is to validate messages as early as possible in order to avoid overloading the system. This would also be used in a Service Implementation pipeline.
There is a performance impact to consider as well. When both the request and response messages are validated, you may see a significant decrease in performance.
You can reduce the impact to performance by only validating the request message.“
Visual Studio Team System (VSTS) - Important resources up to 2004/9
September 20th, 2004
- Visual Studio Team System wiki
http://www.3leaf.com/wiki/ - Visual Studio Team System blog (Q&A and articles)
http://blogs.msdn.com/askburton/ - Visual Studio Team System official web
http://msdn.microsoft.com/vstudio/teamsystem - msdn articles
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvsent/html/vsts-team.asp- Visual Studio 2005 Team System: Designing Distributed Systems for Deployment
- Visual Studio 2005 Team System: Building Robust and Reliable Software
- Visual Studio 2005 Team System: Software Project Management
- Visual Studio 2005 Team System: Enterprise-Class Source Control and Work Item Tracking
- Visual Studio 2005 Team System: Microsoft Solutions Framework
- Visual Studio 2005 Team System: Extending the Suite
- Visual Studio 2005 Team System: Enabling Better Software Through Better Testing
- How to install it in 3 VirtualPCs (1 for Data tier, 1 for App tier and 1 for Client)
http://blogs.msdn.com/mglehman/archive/2004/09/09/227658.aspx - Rob Caron’s blog (VSTS stuff)
http://blogs.msdn.com/robcaron/category/5240.aspx
Here is the whole picture for VSTS
All you want to know about ASP.Net security in 3 pages
September 13th, 2004
This week on the EDRA message board, there was a question about EDRA runtime user context. This made me research on asp.net and IIS security and after some research I posted the IdentityImpersonate handler. Johnatan Wanagel, one of the MS guys that works tight with EDRA, posted these very interesting links…
IIS & ASP.Net Pipeline processing
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/SecNetAP04.asp
IIS authentication settings, the resultant identity that is obtained from each of the variables that maintain an IPrincipal and/or IIdentity object.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/SecNetAP05.asp
The chapter that explains everything about impersonation, WindowsIdentity and ASP.NET Security Architecture in general
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/SecNetch08.asp
ObjectXPathNavigator - use xpath to navigate through object graph
September 2nd, 2004
Today while was reading a post from edjez found this CoolStuff: an xpath navigator to navigate through an object graph
ObjectXPathNavigator: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnexxml/html/xml03172003.asp