Moustafa Refaat
Login   Search
Skip Navigation Links
Home
Publications
Service Offerings
Downloads and Samples
My Resume
Endorsements
Contact Me
Books
Technical Articles
Software Packages
Scroll up
Scroll down
BizTalk The Practical Course
Mastering The BizTalk Technical Interview
Soduku:Challenging Puzzels
Scroll up
Scroll down
Design Patterns Review
Software Architecture Basics Review
Simplified BizTalk Content Based Routing for a Pass_Throu data
An Extensible Light Xml Rules Engine Component
Secure Messaging Solution
Create a SQL Database Programmatically
BizTalk Unzip Adapter
Implementing Singleton pattern with BizTalk Orchestrations
Developing BizTalk Custom Adapters
The BizTalk ESB Toolkit 2.0 experience Series
Scroll up
Scroll down
Setting the ESB Toolkit on the 64 Bit Machines
How The ESB Works
Sample Custom Resolver
Scroll up
Scroll down
Recent Training
Scroll up
Scroll down

News List

  • Toronto Code Camp Presentation is uploaded
  • BizTalk: The Practical Course is recommended by Micorsoft
  • Canadian Gigs Network (www.CanadianGigs.Net) a job web site focusing on Canadian Jobs
  • BizTalk Technical Interview Preparation
  • GT-DataSafe© Online Backup for Amazon Storage Services 3.0 is released
  • Soduku Challenging Puzzles
  • BizTalk: The Practical Course
  • Mastering The BizTalk Technical Interview is Published.

Technical Articles

  • SharePoint List Simplified Configuration Store
  • WCF and xsd:choice how to implement!
  • WCF: Refactoring a Plain old XML web service to a WCF Service
  • Setting the ESB Toolkit on the 64 Bit Machines
  • The BizTalk ESB Toolkit 2.0 experience Series
Skip Navigation Links
> Blog entries about: Web Developmenet
WCF and xsd:choice how to implement!
For some reason Microsoft decided that WCF serialization is not going to support the xsd:choice. The .Net XML serialization does support xsd:choice which is important. Now, if you had a schema that used xsd:Choice and used XSD tool to generate classes for it will generate code similar to:
///<remarks/>
    [System.Xml.Serialization.XmlElementAttribute("Option1", typeof(typeOption11), Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
    [System.Xml.Serialization.XmlElementAttribute("Option2", typeof(typeOption2), Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
    [System.Xml.Serialization.XmlElementAttribute("Option3", typeof(typeOption3), Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
    public object Item {
        get {
            return this.itemField;
        }
        set {
            this.itemField = value;
        }
Well that is look neat does not it? Now if you exposed this same generated code through WCF, the WSDL would generate item as Object on the client side and the consumer would not get any information from the WSDL about typeOption1, typeOption2, nor typeOption3. That is a real pain for the developer on the consumer side!. So one workaround that I had to device for a solution I was developing is to create another class like the following
public partial class Optionss {
 
    [System.Xml.Serialization.XmlElementAttribute("Option1", typeof(typeOption1), Form=System.Xml.Schema.XmlSchemaForm.Unqualified,IsNullable = true)]
    public typeOption1 Option1 = null;
    [System.Xml.Serialization.XmlElementAttribute("Optoin2", typeof(typeOption2), Form=System.Xml.Schema.XmlSchemaForm.Unqualified,IsNullable = true)]
    public typeOption2 Option2 = null;
    [System.Xml.Serialization.XmlElementAttribute("Option3", typeof(typeOption3), Form=System.Xml.Schema.XmlSchemaForm.Unqualified,IsNullable = true)]
    public typeOption3 Option3 = null;
 
}
And chenage the item above to be similar to
    public Optionss Item {
        get {
            return this.itemField;
        }
        set {
            this.itemField = value;
        }
 
Now the options are going to appear to the consumer, however the data you receive is going to be for a different schema so I wrote code that would serialize the received request then “fix” the XML to be corresponding to the actual schema with xsd:choice.  Not quite neat  workaround but it works.
{06/08/2010 2:21 PM} {0 comments}  {Tags: EAI, WCF, Web Developmenet}
Vaughan Online my Latest SharePoint Project

I was working on a project to migrate a SharePoint 2003 implementation to a new 2007 implementation. This new portal involved restructuring, reorganizing and actually a complete a new architecture and UI design. You can see the sample landing page above Very impressive do not you think so? I used Ajax, with SharePoint to develop many of the web parts, I will write later more updates about the lessons learned from this Project, specially the Migration process.
{30/11/2009 8:30 AM} {0 comments}  {Tags: SharePoint, Web Developmenet}
Designing for Secure Deployment of Web Application
I have seen so many cases where an application launch was delayed because there were problems with deploying into the production environment. They generally are all the same story in that it wouldn’t work because the network was set up with some security rules that the application didn’t support or wasn’t designed with that in mind.

 A very common network setup for security is creating a perimeter network or DMZ that “outsiders” can access, but the DMZ is separated by a firewall from the secure internal network. Additionally there might be another firewall inside the secure network separating the database servers.

Because the infrastructure is split into multiple zones, you have to have the same splits in your application architecture to make it possible to deploy on the infrastructure. This also has the related issues of communications across the zones, passing identities, etc. So in more details you have to:

  • Design the architecture to include a cleanly separated business API to ensure there is a distinct business tier.
  • Split the business tier into two parts, creating an “interface” tier and an “implementation” tier.
  • The interface tier is responsible for handling boundary activities such as validation and authentication, while the implementation tier holds the main business logic. This boundary verification logic enhances the security before passing the request to the secure network, beyond what could be done using a firewall alone.
  • The service interface tier gets deployed into the DMZ, and the implementation tier into the secure network.
  • Just one last note, does not that look like the Façade Pattern? Well close, but not the same. Hope this helps you with your system challenges.
{09/01/2006 5:44 AM} {0 comments}  {Tags: Architecture, Deployment, Web Developmenet}

Copyright © Moustafa Refaat 2004 - 2009. All Rights Reserved.