Excellent post of Charles Young about Dublin and BizTalk

I was reading the post of Charles Young about Dublin and BizTalk Server - What's the difference?

I can only say, it's really worth a read, and after reading it, you will probably know you will still be doing BizTalk and XLANG for a long time.
The goodies mentioned in the article that come with BizTalk will just not be available for WF for a long long time to come.

COme on have read of the article here:Dublin and BizTalk Server - What's the difference?

Posted by Patrick Wellink with 3 comment(s)
Filed under: , ,

How to expose an old style WSDL (Flattened) with the schema's included from BizTalk 2006 R2 with a WCF adapter

It is really nice to have WCF around. With WCF you are ready for the future. Unfortunaltely this is only true in a Microsoft landscape. The new style WSDL with the schema's no longer included is one of those enhancements that should be really nice. Unfortunately there are tons of software out there that cannot handle the default WSDL behaviour of a WCF service. Below is a picture of the default WSDL behaviour.

DefaultSoap

And this is not the behavoiur old clients like. So we have to modify the WSDL that's spitted out by a WCF service.

To make things happen I googled around a lot and finally after some very good posts of Thomas Restrepo and LocoTheGrande(Don't know who's behind that blog post) i had a class up and running that should do what I wanted. Below is the code of that class....

 //
// InlineXsdInWsdlBehavior.cs
//
// Author:
//    Tomas Restrepo (tomasr@mvps.org)
//

using System;
using System.Collections;
using System.Collections.Generic;
using System.Configuration;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Channels;
using System.ServiceModel.Configuration;
using System.ServiceModel.Description;
using System.ServiceModel.Dispatcher;
using System.Text;
using System.Xml;
using System.Xml.Schema;
using System.Web.Services;
using System.Web.Services.Description;
using WsdlDescription = System.Web.Services.Description.ServiceDescription;


namespace FH.CE.ESB.WSDL.Extensions
{
    /// <summary>
    /// IEndpointBehavior implementation that will
    /// force WCF to generate all schemas inline into the
    /// generated WSDL files, instead of as individual files.
    /// </summary>
    public class InlineXsdInWsdlBehavior : BehaviorExtensionElement,IWsdlExportExtension, IEndpointBehavior
    {

        #region IWsdlExportExtension Implementation
        //
        // IWsdlExportExtension Implementation
        //
        public void ExportContract(WsdlExporter exporter,WsdlContractConversionContext context)
        {
            // never called
        }

        public void ExportEndpoint(WsdlExporter exporter,WsdlEndpointConversionContext context)
        {
            XmlSchemaSet schemaSet = exporter.GeneratedXmlSchemas;

            foreach (WsdlDescription wsdl in exporter.GeneratedWsdlDocuments)
            {
                //
                // Recursively find all schemas imported by this wsdl
                // and then add them. In the process, remove any
                // <xsd:imports/>
                //
                List<XmlSchema> importsList = new List<XmlSchema>();
                foreach (XmlSchema schema in wsdl.Types.Schemas)
                {
                    AddImportedSchemas(schema, schemaSet, importsList);
                }
                wsdl.Types.Schemas.Clear();
                foreach (XmlSchema schema in importsList)
                {
                    RemoveXsdImports(schema);
                    wsdl.Types.Schemas.Add(schema);
                }
            }
        }

        #endregion // IWsdlExportExtension Implementation


        #region Private Methods
        //
        // Private Methods
        //

        /// <summary>
        /// Recursively extract all the list of imported
        /// schemas
        /// </summary>
        /// <param name="schema">Schema to examine</param>
        /// <param name="schemaSet">SchemaSet with all referenced schemas</param>
        /// <param name="importsList">List to add imports to</param>
        private void AddImportedSchemas(XmlSchema schema,XmlSchemaSet schemaSet,List<XmlSchema> importsList)
        {
            foreach (XmlSchemaImport import in schema.Includes)
            {
                ICollection realSchemas =
                   schemaSet.Schemas(import.Namespace);
                foreach (XmlSchema ixsd in realSchemas)
                {
                    if (!importsList.Contains(ixsd))
                    {
                        importsList.Add(ixsd);
                        AddImportedSchemas(ixsd, schemaSet, importsList);
                    }
                }
            }
        }

        /// <summary>
        /// Remove any &lt;xsd:imports/&gt; in the schema
        /// </summary>
        /// <param name="schema">Schema to process</param>
        private void RemoveXsdImports(XmlSchema schema)
        {
            for (int i = 0; i < schema.Includes.Count; i++)
            {
                if (schema.Includes[i] is XmlSchemaImport)
                    schema.Includes.RemoveAt(i--);
            }
        }

        #endregion // Private Methods


        #region IEndpointBehavior Implementation

        public void AddBindingParameters(ServiceEndpoint endpoint,BindingParameterCollection bindingParameters)
        {
            // not needed
        }

        public void ApplyClientBehavior(ServiceEndpoint endpoint,ClientRuntime clientRuntime)
        {
            // not needed
        }

        public void ApplyDispatchBehavior(ServiceEndpoint endpoint,EndpointDispatcher dispatcher)
        {
            // not needed
        }

        public void Validate(ServiceEndpoint endpoint)
        {
            // not needed
        }

        public override System.Type BehaviorType
        {
            get { return typeof(InlineXsdInWsdlBehavior); }
        }

        protected override object CreateBehavior()
        {
            return new InlineXsdInWsdlBehavior();
        }

        #endregion // IContractBehavior Implementation

    } // class InlineXsdInWsdlBehavior

} // namespace Winterdom.ServiceModel.Extensions

The code above is not the original code of Thomas Restrepo. The last two methods were added by me. I found the directions of how to do that in the post of LocoTheGrande. I made sure that I gac-ed the component an tried to add the behaviour to a Service that was generated by BizTalk. And I tried really hard but could not succeed. So finally I was out of options and decided to write a mail to Thomas Restrepo. His Email address was on hist site so I thought I give it a try. And I got a reply from Thomas the same evening helping me on my way. Basically he said the following things..

1. Make sure the component is in the GAC.
2. Edit the machine.Config
3. Use one of the Custom WCF adapters. (The default adapters dont allow you to change behaviour)

So I fired up the good old svcConfigEditor, looked for the machine.config in the C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727 directory and opened it with the editor. Then I made a modification to support the InlineWsdl behaviour. Below is a screenshot of that.

Then I Went back to BizTalk and fired up the BizTalk WCF Service Publishing Wizard, I then chose the CustomIsolated WCF adapter and finished the Wizard.
After everything was done I opened up the port in the BizTalk Server Administration Console and added my behaviour. Below is a screenshot of that.

Then I browsed to my endpoint and looked at the WSDL..... Ahhhhh reward how nice. The WSDL has all the schema's included.

 

Besides the fact that the WSDL inluded the correct XSD now this also has the benefit of exposing the correct cardinality of the elements.
Hope this helps anywone who is struggeling with this problem. Again many thanks to Thomas restrepo !

 

Posted by Patrick Wellink with 2 comment(s)
Filed under: ,

Interesting stuff coming with the BizTalk Adaper Pack

I really can't wait for the BizTalk Adapter pack. Finally we get a good SQL adapter capable of almost everything. I had concurrency problems in the past cause the Adapter always has a transaction level Serializable. Now with the new SQL Adapter the transaction level is settable. Have a read of the SQL LOB adapter capabillities >> here <<

They also threw in some goodies in the Adapter pack, The various Adapters will now show up as native BizTalk Adapters, have a look >> here <<

Posted by Patrick Wellink with no comments
Filed under: , ,

HowTo define a Custom Soap Header in BizTalk. Expose it, Consume it , even map them..

 

1. Create the schema that defines your custom header. This schema should be a NORMAL schema. (Give it a decent rootnode name)

2. Create a PROPERTY schema with TargetNamespace : http://schemas.microsoft.com/BizTalk/2003/SOAPHeader.

3. Make sure you define a property in the PROPERTYSCHEMA with EXACTLY the same name as the ROOTNODE of the schema in step 1

4. Make sure you set the set the "Property schema base" to "MessageContextPropertyBase" !!!!!

5. Deploy.

That's it...... I was really confused by other posts on the web that are just not clear enough... But the summary above is very short so I will explain a bit more.

First step.

Create a normal schema that represents your custom header. Below is a screenshot of my schema.

But I also wanted to send a custom header, so I had to create a second schema representing my outgoing envelope.

 

Second step.

Now I had to create a property schema. Taking care that my property names where EXACTLY the same as the Rootnodes in the schemas. I also had to set the namespace to the correct SOAPHeader namespace.

After setting  the "Property schema base" to "MessageContextPropertyBase” I deployed everything. And I was basically ready to go.

The orchestration

I created a very simple orchestration. It Receives a message, Maps it to the output and sends the output back. More on this orchestration later. I then generated a web service With the wizard that came with Biztalk. It is probably important to mention that when generating the service, I added extra SOAP headers. As the inbound header I specified the “inHeader” schema  and as the outbound header I specified the “outHeader” schema (So not the propertyschema). Then after some wizardry of the wizard, I fired up my trusted WebService Studio tool” and hit the GET button. I was presented with the following picture..

Everything I was expecting, was there. So it was very easy to send and receive headers.

Receiving

After receiving the message, the Adapter (it also works with PASSTHROUGH) will strip off the header and put it into the context property. Below is a screenshot of the received message. As you can see there is no messagetype set so it was received via a passthrough pipeline.

But how nice … the context property "inHeader" contains an XML document with the content of the SOAP header.

So if you want to get to a Specific SOAP Header in an Orchestration. The following code should do the trick.

 

Sending

For Sending messages with the header it works the other way around. Just make sure you have set the content of the outbound header context property to an XML document representing a valid header. I created mine with the mapper.

Then I threw in a shape where I put the contructed document into the context property…

And Presto….

 

 

 

 

Posted by Patrick Wellink with no comments
Filed under: ,

New Style SSO Available on Codeplex

If you are working with BizTalk you know the dilemma, where do I store my configuration data. Could be on several locations. Have a read of this article to have some in-dept information.

I created a base class SSOBaseFunctionality thad deals with storing and loading configuratioin data to and from SSO. So if you want to store a specific class in SSO just make sure it inherits from SSOBaseFunctionality and you are ready to go.

The project is on Codeplex.

Your class could simply look like this.

     [Serializable]
    public class SampleConnectionData:SSOConfigItem
    {
        public SampleConnectionData(string ApplicationName)
        {
            base.SSO_ApplicationSettingName = ApplicationName;
        }

        public SampleConnectionData()
        {
        }

        private string dataSource = string.Empty;
        private string database = string.Empty;
        private string applicationName = string.Empty;
        private string userName = string.Empty;
        private string password = string.Empty;
        private bool trustedConnection = false ;

        public bool TrustedConnection
        {
            get { return trustedConnection; }
            set { trustedConnection = value; }
        }
 
        public string Password
        {
            get { return password; }
            set { password = value; }
        }

        public string UserName
        {
            get { return userName; }
            set { userName = value; }
        }
 

        public string ApplicationName
        {
            get { return applicationName; }
            set { applicationName = value; }
        }
 
        public string DataSource
        {
            get { return dataSource; }
            set { dataSource = value; }
        }
      

        public string Database
        {
            get { return database; }
            set { database = value; }
        }
   }

And then you will have functionality like this :

// Create a SSO connection class.
SampleConnectionData objConnection = new SampleConnectionData("SomeApplicationName");

// Set properties
objConnection.TrustedConnection = true;
objConnection.DataSource = "(Local)";
objConnection.Database = "Master";
objConnection.ApplicationName = "DemonstrateUsage";

// Create the applications
objConnection.CreateApplication();

// Save the application
objConnection.Save();

// Get a new Object
SampleConnectionData OtherConnection = new SampleConnectionData("SomeApplicationName");
// Load properties from SSO Configuration Store
OtherConnection.Load()

 

Posted by Patrick Wellink with no comments
Filed under: ,

Choosing the Right Workflow Tool for Your Project

 And another interesting artickle here >>CLICK<< about Choosing the Right Workflow Tool for Your Project

Posted by Patrick Wellink with no comments
Filed under:

Some guidance on BizTalk Testing.

 Via BlogLines I monotor lot's of BizTalk feeds. And once in a while there is an article worth reading. The same with this article >>CLICK<< from michael Stepenson. It has some interesting points about BizTalk testing. Worth a read.

Posted by Patrick Wellink with no comments
Filed under:

Using a Bitwise AND in a BizTalk Send Port as a Filter Expression

I knew this was possible but I guess a lot of people are unaware of this functionality.
Somebody told me I  should blog about it, so here I am adding another entry to my Blog.

How to define the BitWise and in a send port.

  1. Define a property schema in biztalk and make sure one of the properties is of the type unsigned int.
  2. Now deploy that propertyschema.
  3. Now add a send port and go to the filter Expression.
  4. Select the Unsigned int in the first part of the Exprssion
  5. Then open the dropdown and see... there it is ...

the magical, almost undocumented, rarely seen, extra operator &. (standing for Bitwise AND)

Posted by Patrick Wellink with 1 comment(s)
Filed under:

Microsoft BizTalk Server Operations Guide

This is  a post from Microsft Download Center. I found it in my RSS feeds. (Don't know where). It's such a usable BizTalk document that I really don't want to loose the link so it's a reminder for myself. But a nice read (+700 pages) for anyone who is involved in BizTalk Developement.

get the download link >>HERE<<

Brief Description
Provides detailed information for planning a BizTalk Server environment, as well as recommendations and best practices for configuring, testing, maintaining, monitoring, and optimizing this environment.
 

Overview

A valuable resource for anyone involved in the implementation and administration of a BizTalk solution, particularly IT professionals. The guide provides detailed information for planning a BizTalk Server environment, as well as recommendations and best practices for configuring, testing, maintaining, monitoring, and optimizing this environment.
Posted by Patrick Wellink with no comments
Filed under:

Suspended Messages are Included in the Message Count in Database Throttling Threshold

I had read this once but I couldn't remember where. But it can be of importance to BizTalk developers when they have the question :

"To Suspend or Not to Suspend".

When you are faced with this question, remember that Suspended Messages are Included in the Message Count in Database Throttling Threshold. see the details >>here<<

 

Posted by Patrick Wellink with no comments
Filed under:

Finally Project templates in BizTalk 2006 / BizTalk Template Wizard

I have a certain aproach on how to solve common integration scenarios. It involves Process Services, Business Services, Receiving Interation services and Sending Integration Services. It's a clean way to set up an integration. Although it is a flexible way of setting up a project, it initially requires some extra work.

I have looked at this excellent post from Charles Young. It looked so sweet, but I couldn't get it to work for BizTalk 2006. Then I had a very seriuous look at the BizTalk Pattern Wizard from Jon Flanders. I tried to use it, but unfortunately there is very little documentation.

But when I was experimenting with this stuff I found out the following :

  • If I created a subdirectory in the following directory : C:\Program Files\Microsoft BizTalk Server 2006\Developer Tools\BizTalkProjects , it would show up as a kind of template directory in Visual Studio. Below is a screenshot of this. On the left is the directory structure and on the right is the screen as it shows up in Visual Studio.

  • Next I found out, in this 'Template directory' you will need two files. An 'ICO' file and an 'VSZ' file. Below is a sample of the VSZ file. The name of the files should be scenarioname.(ico/vsz)

VSWIZARD 7.0
Wizard=VsWizard.VsWizardEngine.8.0
Param="WIZARD_NAME = SimpleTemplate"
Param="WIZARD_UI = FALSE"
Param="PROJECT_TYPE = BTPROJ"
Param="SCRIPT_COMMON_RELATIVE_PATH = BizTalkWizards"
Param="RELATIVE_PATH = BizTalkWizards"

  •  Then I found out that there is a subdirectory called BizTalk Wizards, If you create a Subdirectory with the name of the 'WIZARD_NAME' Visual studio would open the directory, and execute a JavaScript scriptlet to do some processing. Below is a Sample of the directory Structure.


  • Not beeing a JavaScript programmer at all, I modified this 'Default.js' so it would do some specific stuff. ( Move files and then do a search and replace ).
  • Then I created a project that would be the template. I had a specific namespace and some other specific stuff ( the strings that would be replaced).
  • And presto the template was finished.

Now its only a matter of seconds to create the projects. The naming convention should be SomeProject.ServiceKind,ServiceName. The templates really expect a dotted name where tle last part after the last dot is the actual service name.

  1. If you want to try this yourself, extract the files in the zip file ESB Concept Scenarios.zip to the directory C:\Program Files\Microsoft BizTalk Server 2006\Developer Tools\BizTalkProjects\ESB Concept Scenarios, so that the directory will contain two files. SimpleTemplate.ico and SimpleTemplate.vsz.
  2. Next you extract the following file SimpleTemplate.zip to the following directory BizTalkWizards. The result should look the same as the picture above.
  3. Next Start Visual Studio, Create a new BizTalk Project, Select SimpleTemplate and see stuff happen. (Don't forget the name yoy enter for the project should be in the form , SomeProject.ServiceKind,ServiceName otherwise it won't work.

If  You don't like the template or want to change it, simply go to the BizTalk Wizard directory and perform the following steps.

  1. Select the template you want to change.
  2. Next go to the 'Templates\1033\OriginalProject' directory.
  3. Open the solution.
  4. Make any change you want, and save the project.
  5. Copy only the Orch / Map and XSD one level up. Do not copy the SLN and BTPproj files. (Have a look in the notepad at both of them and you will probably spot the diffrencies).

That's it.

If you want to see this for yourself, have a look at the video in this zip file Templates_in_action.zip

Posted by Patrick Wellink with no comments
Filed under:

The truth about Dynamic SQL and Stored Procedures....

Well I am not going to say what's better or what I prefer, but I can only give my view of things.


What everybody seems to forget is that an external person with very good understanding of SQL (commonly know as a DBA) can solve performance problems when stored procedures are used.
And I totally agree that Stored Procedures are overkill for most of the the simple CRUD functionality. So I am not going to start a debate about that.


But just one question for all those who are against stored procedures.


What if the generated dynamic SQL performs bad. If a SPROC was used a SQL DBA could have tuned the query.
And by tuning I don't mean adding some indexes, but maybe cursor's / memory tables / views / CLR etc. Just to get the results in the fastest possible way.


How would you do this with dynamic SQL ??

Posted by Patrick Wellink with 5 comment(s)
Filed under:

Some very interesting BixTalk/WCF screencasts

I was looking at my list of Blog entries at bloglines and I saw an interesting screen cast from Aaron Skonnard I decided to have a look and was surprised to see how many extra functionality is provided by the WCF adapters. I decided to look at some more web cast about the WCF adapters and learned very interesting new things. Have a look at them and see if you learn something new.

Screen cast: BizTalk WCF Adapters -- Send Port Basics

Screen cast: BizTalk WCF Adapters -- Send Ports & Custom WCF Bindings

Screen cast: BizTalk WCF Adapters -- Send Ports and Action Mappings

Screen cast: BizTalk WCF Adapters -- Send Port Message Templates

Posted by Patrick Wellink with no comments
Filed under: ,

BizTalk ESB guidance Available on MSDN

Yesterday it was my Birthday and how nice of Microsoft to give me what I really wanted ....

 The BizTalk ESB guidance is available for download NOW

Go and get it here : http://www.microsoft.com/downloads/details.aspx?FamilyID=e3957253-24ce-45aa-ac32-60abffe15bac&DisplayLang=en

Posted by Patrick Wellink with 1 comment(s)
Filed under: ,

BizTalk V-Next

At last they have shed some light on what the next version will be :

Service Oriented Architecture

Deeper alignment with the .NET Framework – Building deeply on the investments made with Windows Communication Foundation and Windows Workflow Foundation by closer alignment of these technologies and BizTalk Server to enable customers to build richer composite applications and service oriented architectures than they can today.

Hosted Services – BizTalk Services, which represent hosted versions of a core set of platform services. While currently in incubation, BizTalk Services is an Internet Service Bus (ISB) that combines identity and access control, message routing (relay), and publish/subscribe event brokering (eventing). For more information, see BizTalk Labs.

Composite Applications

Broader Model Support – Building on the work with XLANG (BizTalk Server) and XAML (WF) by providing a richer set of domain-specific models

Runtime – Building on the host investments made with WF and BizTalk Server, to enhance the deployment and management experience of composite applications.

Business Process Management

Human Tasks – Integration with SharePoint Server to provide expanded support for human task-based scenarios.

Model Driven – Enhancements to existing visual modeling and design experiences that span roles and help foster team collaboration.

Complex Event Processing – Enhancements to BAM to provide broader monitoring support.

complete post, have a look here

Posted by Patrick Wellink with 2 comment(s)
Filed under: , ,
More Posts Next page »