Thursday, December 08, 2011

IASA Architect Core training completed

I’ve completed the IASA Architect Course and have completed the exam for “IASA Foundation Certification”. My review of the course is that it is really good, in direct applicable aspects of architecture and for long-term development of personal skills. This is what “IASA Foundation” stands for: · The foundation phase of an architects career is focused on understanding the skills, capabilities and knowledge a practicing architect possesses. Although many architects have already reached significantly higher phases in their career, very few did so in a standard way. Most learned through trial and error, often in the most difficult ways. The foundation phase of an architects career will be a time of discovery to understand how an architect practices, what it means to specialize, and what an architect will need to know to be successful. Iasa calls those that are looking to become architects, Aspiring Architects. Whereas, the first full phase in an architects career is marked by reaching the Foundation Certification. It represents individuals who have demonstrated awareness of the Foundation ITABoK through a multiple choice exam. More importantly the Iasa certification represents a personal awareness of all of the required skills and associated knowledge for a practitioner. Even seasoned professional architects who have attended the Iasa Core training, which prepares architects for the exam, have stated how valuable this kind of comprehensive approach is to them.



Sunday, October 30, 2011

Changing BizTalk Mapper Item templates

 

To be able to configure default value for artifacts that are created from within Visual Studio we can leverage the ‘Item Template‘ functionality.

I have done this to adjust the mapping behavior , specifically the value for setting ‘GenerateDefaultFixedNodes’ which is default ‘YES’. See my previous post on this subject.

Below are the steps to follow

The ItemTemplates is a folder that contains the template files used when you create a new item.

clip_image001

The map template can be found in the folder: Map Files

This is a .zip file that contains a .BTM file. Change the value of ‘GenerateDefaultFixedNodes’ to one of the above values and save the .zip file.

clip_image002

After changing the value, the template is not working, why??? The templates are cached in the folder:

C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\ItemTemplatesCached\BizTalk\Map Files

clip_image003

clip_image004

You have to register the value by entering the following command (devenv /installvstemplates):

clip_image005

Note: if you have multiple zips files, the FIRST zip file is used, i made the mistake to rename the original Map.old.zip, which still resulted in the old template to be registered.

If you create a new MAP, the template will now be used:

clip_image006

clip_image007

Note: The only supported values are: ‘Yes’ / ”” / ‘RequiredDefaults’, i recommend to use ‘RequiredDefaults’

Be sure to read this (Accommodating Schemas with Large Footprints)!

http://msdn.microsoft.com/en-us/library/aa561485(v=bts.10).aspx

“when the GenerateDefaultFixedNodes flag is set to No, the default field values set in the target schema are not preserved in the instance produced by the map. This is a problem when these values are required in the target instance”.

 

HTH,

Sander Nefs

BizTalk Mapper vs Attributes with Defaults….Schema Elements with an attribute having a default value are ALWAYS generated

 

‘Challenge’:

Schema Elements with an attribute having a default value are ALWAYS generated, this is because of the default mapping behavior.

Structure of this post:

What is the problem

Attributes with a Default Value are generated even though the element is optional. Consider this schema, which has an Data element.

image

The element ‘OptionalAttributeDefault’ is optional (minoccurs:0) and has an attribute with a Default value: ‘LINUX’

image

The element ‘RequiredAttributeDefault’ is mandatory (minoccurs:1) and has an attribute with a Default value: ‘CAT141.12’

image

The element ‘RequiredDefaultValue’ is mandatory (minoccurs:1) and has a default value: ‘Test’

image

When we execute the map which does not map the ‘Data’ element like this:

image

The XML output generated is:

<ns0:Destination xmlns:ns0="http://AttributeTest.Schema2">
    <Name>Name_0</Name>
    <ID>ID_0</ID>
    <Data>
        <OptionalAttributeDefault Type="LINUX"></OptionalAttributeDefault>
        <RequiredAttributeDefault Type="CAT141.12"></RequiredAttributeDefault>
        <RequiredDefaultValue>Test</RequiredDefaultValue>
    </Data>
</ns0:Destination>

Issue: All [DATA] elements are generated, optional elements with an attribute default as well

 

Why is this

This is because the .btm file is configured with a behavior to always generate the default values, even for optional elements.

Although we can state that the default values have to be removed, that is not always possible. I came across this issue when implementing UBL (from OASIS).

 

How to overcome this

We can overcome this be altering the behavior of the map, this can be done by opening the .BTM file and navigate to the attribute: ‘GenerateDefaultFixedNodes’, which is default “YES”.

Before making any changes, we have to understand which options there are:

  • GenerateDefaultFixedNodes=”Yes” : default behavior
  • GenerateDefaultFixedNodes=”” : this will generate no elements if the attribute has a value, even when the element is mandatory!

Note: you can set the value to whatever (no, false, etc) however when you save the map it will become “”

Example result:

<sns0:Destination xmlns:ns0="http://AttributeTest.Schema2">
  <Name>Name_0</Name>
  <ID>ID_0</ID>
</ns0:Destination>

Issue: No [DATA] element is generated

  • GenerateDefaultFixedNodes=”RequiredDefaults” : this will generate elements with minoccurs=1 in case it has attributes with a default value

Example result:

<ns0:Destination xmlns:ns0="http://AttributeTest.Schema2">
    <Name>Name_0</Name>
    <ID>ID_0</ID>
    <Data>
        <RequiredDefaultValue>Test</RequiredDefaultValue>
    </Data>
</ns0:Destination>

Issue: results are still not valid (Required elements with default attribute value are not created, thus validation fails

 

This means that even though you can configure the behavior of the mapping there is no perfect solution. You either have:

  • to modify the default values and use the default behavior
  • have to ensure that elements/attributes are set (you can not rely on any of the default attributes anymore since elements are not created)

 

Since this is quite important, I’ve created a sample project that has a map for each setting, and a readme.txt with information about the results.

In the next post I will explain how to change the ‘template’ used when creating maps.

HTH,

Sander Nefs

 

Friday, October 28, 2011

BizTalk Scripting functoid explorer (codeplex)

 

I came across this tool to extract the scripts from maps found in a folder and really like it.

Running the tool on my project BizTalk 2010, I had some errors (minor), I have posted a patch with some minor modifications.

If anyone is an Xslt Guru, please contribute because this would make it a perfect tool to generate Mapping documentation!

 

Cheers,

Sander

Wednesday, October 26, 2011

Flat File schema - The tag overlaps one or more fields that contain a fixed data value

 

I recently had to patch up a schema that was defined but had to be evaluated for re-usability.

This warning was generated:

Warning    1    Record "RecepientOrderShipDetail" - The tag overlaps one or more fields that contain a fixed data value.    \OrderShipped_FF_<System>.xsd

 

The record RecepientOrderShipDetail had a TAG identifier which was correct, however for some reason a child atrribute @RecordID has a FIXED value with the same value as the parents TAG identifier.

image

Since both the TAGS were working on the same Offset the positional ‘bandwidth’ was used by the Attribute.

To prevent this warning I removed the fixed value of the Attribute

 

Since this error is rather unclear I hope this helps in solving the problem when you run into this.

 

Regards,

Sander

Saturday, October 15, 2011

BizTalk Deployment Framework – Always provide the OutputPath!

A hard lesson I learnt….as I was fiddling around with the BizTalk Deployment Configuration, ALWAYS make sure to define a property group applicable to your configuration and be sure to set the OutputPath. I had defined several propertygroups and modified the conditions to make sure it would work on a build server (provided additional MSBuild properties), however I forgot one combination, the PropertyGroup for the ‘Release’ configuration. I had set my BTDF project to configuration ‘Release’….which led to a not so cool outcome…files were removed from C:\

This is caused by the WixTargets file (MSBUILD\Deployment Framework For BizTalk\5.0\BizTalkDeploymentFramework.WiXSetup.targets;

      <!-- Delete any existing output files -->
    <CreateItem Include="$(OutputPath)\**\*.*">
      <Output TaskParameter="Include" ItemName="OutputsToClean" />
    </CreateItem>

If the $(OutputPath) is not provided the value become “.” causing the effect.

You can overcome this (until RC2 is out) by adding the following to you targets file:

  <Target Name="Installer" DependsOnTargets="Redist">
           <Error Text="The build was aborted, no OutputPath provided"  

          Condition="'$(OutputPath)'" />

Which will stop the build;

Build FAILED.

"C:\Projects\Rfs.Integration\Dev\Rfs.Integration.Common\Rfs.Integration.Common.Deployment\Rfs.Integration.Common.Deployment.btdfproj" (Installer target) (1) ->
(NoOutputPath target) ->
  C:\Program Files (x86)\MSBuild\DeploymentFrameworkForBizTalk\5.0\BizTalkDeploymentFramework.WiXSetup.targets(206,3): error : The build was aborted, no OutputPath provided [C:\Projects\Rfs.Integration\Dev\Rfs.Integration.Common\Rfs.Integration.Common.Deployment\Rfs.Integration.Common.Deployment.btdfproj]

    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:01.23

 

Hope this prevents someone from making the same mistake. Also, make sure you make enough backups! (and keep them Bedroefde emoticon)

 

Sander

ESB Toolkit ‘DSL Itinerary error (XML Node not serializable)’

Today I received this error;

Cannot save 'C:\Projects\<SolutionFolders>\<NameOfItinerary>.itinerary': Type 'System.Xml.XmlNode' in Assembly 'System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' is not marked as serializable.

 

As stated in the Biztalk social forum ;

- Somehow one of the shapes led to a corrupted itinerary

- Remove the shapes one by one to identify the one generating the error

- Recreate the shape

- It now works…magic!

 

Also make sure that everything is properly deployed  (when using an orchestation extender) before changing the itineraries.

 

HTH,

Sander

Saturday, October 08, 2011

WCF-Oracle and Oracle Advanced Queing (AQ) – tips

If you use the WCF-Oracle adapter to communicate with Oracle Advanced Queing you are in for a treat. We followed the steps suggested in a very good MSDN post. There are however some caveats;

  • Username is case sensitive
  • The generated schemas have a reference to the package, and Database schema, make sure this is consistent throughout the environments
  • The generated schemas are slightly different then what the WCF-Oracle adapter expects in some cases (more on that below)
  • Use a count procedure to determine if there are messages

Generated the schemas is done by following the standard ‘Add Generated items’ wizard so that should not be hard to do. When you generate schemas for Oracle they will typically have the targetnamespace:

/Package/http://Microsoft.LobServices.OracleDB/2007/03/<DATABASESCHEMA>/Package/<PACKAGENAME>

Where the <DATABASESCHEMA> could be something like ‘DBOWNER’ and the packagename could be whatever.

When you implement this everything seems ok, until you start testing, receiving messages won’t work (not supported exception stating that the action is invalid;

image

This is because the WCF-Oracle adapter expects a different targetnamespace!!

See the namespace below with the subtile change from ‘Package’ to ‘PollingPackage’ ;

 

http://Microsoft.LobServices.OracleDB/2007/03/<DATABASESCHEMA>/PollingPackage/<PACKAGENAME>

  • I therefore strongly recommend to generate a separate schema for each receiving procedure (this allows you to alter the targetnamespace), as it works fine for non receiving procedures which can be generated into a single schema.

 

Another thing that will get in the way is that the generated schema is somehow now in lign with the message returned;

The message structure is pretty logical;

clip_image001

The generated items wizard however generates somewhat different;

clip_image002

  • Take this into account when receiving the message in my case I had to extract the message body out of an envelope so I used the WCF feature to extract this body out using XPath

/*[local-name()='DEQUEUE']/*[local-name()='DEQUEUEResult']

 

To be sure to only receive messages when there are messages on the queue, define a stored procedures that checks for messages.

The adapter can then be configured like this:

Property

Configuration

PolledDataAvailable Statement

SELECT <DATABASESCHEMA>.<PACKAGE>.<PROCEDURE> FROM DUAL

PollingAction

http://Microsoft.LobServices.OracleDB/2007/03/<DATABASESCHEMA>/PollingPackage/<PACKAGENAME>/<PROCEDURE>

PollingStatement

<ns0:DEQUEUE xmlns:ns0=/Package/">http://Microsoft.LobServices.OracleDB/2007/03/<DATABASESCHEMA>//Package/">Package/Package/">/<PROCEDURE> />

 

This should get you right on track!

 

Sander

Friday, October 07, 2011

New look and feel

Hi there,

Minor update on my blog, I completely changed to look and feel, hopefully it’s now more accessible.

I will try to update my blog more often!

 

Regards,

Sander

Friday, September 23, 2011

Use ETW to Trace messages inside an orchestration

I've been using the ETW framework heavily and it works great. Before i knew ETW i would use:

System.Diagnostics.Trace.Writeline("Message data: " + xmlDoc.OuterXml) which works geat.

I wanted to log the data using ETW, however i can not get it to work with ETW, anyone knows what the deal is?

CODE

xmlDoc = inboundMessage.XmlMessage;

Microsoft.BizTalk.CAT.BestPractices.Framework.Instrumentation.TraceManager.WorkflowComponent.TraceInfo(

"message data: {0}", xmlDoc.OuterXml

);

OUTPUT IN DEBUGVIEW: [11992] [1]1B4C.1638::09/23/2011-17:41:53.583 [Event]:ŽS?S

Note: when i use the old scool Trace it works as expected, so it's now the message/encoding BOM etc.

Thursday, September 15, 2011

Build notification tray

In my last post I described how to set up a build server for Biztalk well….a build server isn’t completed with a build monitor tool!

Installing VS.Net + TFS Client installs a tool out of the box;

buildnotifications1_3

It provides a clean interface and even allows you to view the details of the build!

buildstarted

 

If you have the ability to setup a machine with TFS access and a dedicated monitor you can use the BuildMonitor

tfsst

 

Happy building!

 

Sander

Sunday, September 11, 2011

Setting up a build server with the BizTalk Deployment Framework

This chapter describes the steps to a TFS Build Server to set up BizTalk deployment with the following functionality:
• Build solution
• Perform unit testing Using BizUnit
• Create Deployment Packages Using BDTF
• Deploy to Server Using R packages created in previous step
• Create documentation BizTalkDocumenter

For this the following steps are required:• Installation Components (30 min)
• Configuring a build account (30 min)
• Setting up the build service (30 min)
• Scrum template installation (30 min)
• Share for the build output directory (10 min)
• Adjustments Build Template for use BTDF (30 min)
• Design of build definitions (60 min)
• Setting BTDF (60 min)
• Use BTDF
• Build execution / scheduling

UPDATE (21-06-2013)
- When using sharedassemblies, the following URL is a big help http://mohamedradwan.wordpress.com/2013/01/31/set-custom-assemblies-path-for-host-build-service-on-the-cloud/
- For viewing the basic instructions a video is available on the following blog
http://biztalkci.codeplex.com/releases/view/74970

The BizTalk project component

The BizTalk project component is needed to build BizTalk projects to build and is available on the BizTalk installation DVD. Run the BizTalk setup and check the 'Project Build Component.

image

BizTalkDocumenter + HTML Help Workshop

Install [BizTalkDocumenter] and [HTML Help Workshop], it may be necessary to make an adjustment to the configuration file of the BizTalkDocumenter because it emanates from a 64-bit version of HTML Help Workshop. Adjust the configuration file as in this example is shown (highlighted in yellow);

<add key="HelpCompilerLocation" value="C:\Program Files (x86)\HTML Help Workshop\hhc.exe" />

BizTalk Deployment Framework

Install the [BizTalk Deployment Framework] through the installation process; after installation there are two that should be created/updated;















C:\Program Files\BizTalk Deployment Framework

(contains documentation, sourcecode, binaries.)

C:\Program Files\MSBuild\ BizTalk Deployment Framework

*Contains the MSBuild targets (normal + for WIX MSI generation).


These folders are crucial in the steps described later and are very important *

Configuring a Build Account

TFS works with a build service under which the build is performed, this account requires the rights:
· Local Administrator (read registry values​​, create files etc.)
· BizTalk Administrator (for creating BizTalk applications)
· BizTalk SSO Administrator (for creating / reading SSO applications)
· Project Collection Build Service Accounts (TFS)
Note: the member of the build service account Collection Project Administrators is not necessary but very handy!

Setting up the Build Services
The TFS Build server uses the following components;
• Build Service
• Build Controller
• Build Agent
Setting up these components is described in the Microsoft Developer Network Guide [Configuring your build system].

Install the TFS Scrum template

the SCUM template is used to apply Agile principles in TFS, the template is available and the installation files and guide can be found at [TFS Scrum template].

Share for the build output directoryWhen a build is executed, there is location required where output files are written to. The build output directory will contain the log and other important files, this setting is essential. Create a folder and grant the build service account permissions to this folder.

Note: There also seems to be a bug in TFS causing the drop folder always to be required, if it is not configured you will receive the following error: TF270006: The drop location for this build was empty. (caused by a check in the xaml Build template)

Build Template modifications for use BTDFBecause the BizTalk Deployment Framework project file (". BTDF") is not a file type supported as a TFS project alterations to the build template are required. These steps are described in the following post [Build Projects Using BizTalk Deployment Framework TFS2010]. Remember to save the template as a new template!

Note: This section describes what the command line parameters is wrong and must be:

String.Format(“/p:SkipInvalidConfigurations=true /t:Installer {0}” , MSBuildArguments)

Build DefinitionIn order to test the code we need 2 build definitions;
1) Build BTDF, which is based on the custom Build Template, called Build Definition, this will use BTDF to generate MSI files and deploy to the build server
2) Build Classic, which carries out the unit tests (which require the BizTalk environment to be set up)

BizTalk Deployment Framework Build Definition

Click the right mouse in the Team Explorer window for the option "New Build Definition"

image

Choose a name for the build definition.

Trigger
image

Configure the build so that it runs every day and the morning has been completed.

Workspace

Because each build is defined per solution it is important only the relevant part of source control is taken, otherwise the entire workspace will be retrieved during the build process which will lead to a slow build.

image

Configuration Output folder
Configure the build output directory where the files it copies are generated during the build (very useful for logging information).

image

Build Template (only for BTDF)

The template must be chosen to build the BTDF projects, this template contains the previously modified changes to enable support for BTDF projects.

image

Build Solution + BTDF

It works with BTDF already build files, this requires that two projects are selected: the BTDF project which should be build and the associated project.

image

BTDF Specific settings

It is not desirable that a work item is created due to a build error, it is necessary to build for the X86 platform as the BizTalk build fails otherwise. We can provide some MSBuild properties to use in BTDF which can override MSBuild property (e.g. to define whether we work on the build server etc.).

MSBuild Arguments: / property: OnBuildServer = True
MSBuild Arguments: / property: generate documentation = * True
* (for performance reasons it is desirable to define it once in the last scheduled BTDF build)

Below shows an example where a property is defined;

image




Regular Build Definition
Follow the same steps as explained in the beginning "BTDF Build Definition":
• Trigger
• Workspace
• Build Output folder
• Process
For a regular build, the default template to be used;

image

After that the project to be build can be selected;

image

For the Automatic testing properties it is important to select the test the settings from the solution to select, this allows for deployment to deploy folders and the like in the projects.

image

It is not desirable (initially) that a work is created after each build error, it is necessary to further build the X86 to run as the BizTalk build fails otherwise.

image

Setting up the BizTalk Deployment Framework

The BizTalk Deployment Framework (BTDF) uses MSBuild, MSBuild uses definition files which to carry out steps and dependencies are determined (so called. Target files). To change the behavior of BTDF we have to modify the target file, located on the build server.

Location of the .Targets file: C:\Program Files (x86)\MSBuild\DeploymentFrameworkForBizTalk\5.0




Targets BizTalkDocumenter

To ensure that the BizTalkDocumenter is called after the build we add a target that is called based on the provided MS Build argument;



<Target Name="DocumentBizTalk" Condition="'$(GenerateDocumentation)' == 'True'">


<Exec Command="&quot;C:\Program Files (x86)\Microsoft Services\BizTalk Documenter\Microsoft.Services.Tools.BiztalkDocumenter.exe&quot; /o:C:\BizTalk\Releases\$([System.DateTime]::Now.ToString('yyyyMMdd'))\ /def /show:false" />

</Target>

Note: The &quot; is required because the path contains spaces! GenerateDocumentation ensures that the BizTalkDocumenter code is only called when this is provided as a MSBUILD property.

To call the BizTalkDocumenter Target the ‘DeployDependsOn’ has to be altered:



...

BounceBizTalk;

DocumentBizTalk

</DeployDependsOn>

Setting up the BizTalk Deployment Framework ProjectAfter creating a BizTalk Deployment Framework Project it is necessary to perform the following steps:
· Customizing Property Group
Copy a property group (based on the Debug) and add a condition to:


Condition="'$(OnbuildServer)' == 'True' And '$(Configuration)' == 'Debug'"

Make sure that the output path contains the following value (example);



C:\BizTalk\Releases\$([System.DateTime]::Now.ToString('yyyyMMdd'))\

If necessary, other settings can be overwritten, below is an example of a property group based on the definition established in the MSBuild property 'OnBuildServer "



<PropertyGroup Condition="'$(OnbuildServer)' == 'True' And '$(Configuration)' == 'Debug'">

<OutputPath>C:\BizTalk\Releases\$([System.DateTime]::Now.ToString('yyyyMMdd'))\</OutputPath>

<DeployPDBsToGac>false</DeployPDBsToGac>

<PortBindingsMaster>BUILDSERVERPortBindingsMaster.xml</PortBindingsMaster>

</PropertyGroup>

<PropertyGroup Condition="'$(OnbuildServer)' == 'False' And '$(Configuration)' == 'Debug'">

<OutputPath>bin\debug\</OutputPath>

<DeployPDBsToGac>false</DeployPDBsToGac>

</PropertyGroup>

· Add a BUILDSERVER<bindings>

Add a BUILDSERVERPortBindingsMaster.Xml file to the .Deployment project with the bindings used in the BizUnit tests.


Common errors

Test Settings are not included in the build definitionSee the step "Process" to "Regular Build Definition '


TF270006: The drop location for this build was empty.

“The build definition '.... "(or build the request) must Specify a valid UNC path as the drop location for the build. Update the build definition and try again.”

This is a bug in the build process, there is no specified Drop Folder, even if it is unchecked that a leaflet drop is used there seems always to be specified.

Error ‘.cs files of schemas could not be found’

Change platform to X86

Dll can not be found in the project

Select the entire workspace or at least the folder that might have been used containing all the referenced assemblies.


Good luck!

Thursday, August 25, 2011

BizMock using it for orchestration unit testing

BizMock is a tool that allows for testing BizTalk artifacts without having to deploy artifacts. This is done by a private BizMock adapter that receives the messages.

BizMock generates a class based on an XML configuration file where the mapping to schemas, sample files, maps, orchestrations, mapping from logical to (virtual) physical ports are defined (all in your head Bedroefde emoticon).

Advantages: The generated code to perform the test is simple, powerful and compact.
Disadvantages: It uses T4 templates; errors in the XML file are very difficult to debug and resolve. There is little documentation available and sample code does not show all possibilities.

Note: According to the developer a DSL tool is on the way providing an easy mechanism to manufacture the Xml file!

In the segments below are some code snippets that shows the usage of BizMock;

Application
The figure below is a sample project with two schemas, a map and an orchestration.

clip_image001

The sample orchestration receives a message from a location, performs a transformation, and then sends the message through a send port.

clip_image003

In order to test this orchestration you would normally have to deploy, create two physical ports bind these to the logical orchestration ports. After starting the bound ports, you realize that the full control rights haven’t been granted…ugh! Well fix this and we can start manually by creating some files…oh boy, haven’t even mentioned correlations…doing all this by hand is..... quite cumbersome.

BizMock offers an adapter that can simulate the physical ports by trapping messages and manipulate the behavior of BizTalk so that messages can be influenced. This prevents a lot of BizTalk configuration having being done in order to perform some tests.

BizMock provides a sample project that contains an Artifacts.TT file that should be copied to your application, the example Artifacts.XML can be viewed as a reference as your own Artifacts.XML is going to be quite different (different schema, different ports, namespaces etc).

clip_image004

The T4 template (Artifacts.tt) is used to convert the XML file to a class that can be used in the tests. The XML File (Artifacts.Xml) is a file that describes the various BizTalk artifacts, here is sample example Xml definition for my test project:

Orchestration

<Orchestration>
    <Name>OrderApproval</Name>
    <FullName>BizMockTest.OrderApproval</FullName>
    <Ports>
    <Port>
        <Logical>RcvOrderRequestPort</Logical>
        <Physical>PhysicalRcvOrderRequestPort</Physical>
    </Port>
    <Port>
        <Logical>SndOrderApprovalPort</Logical>
        <Physical>PhysicalSndOrderApprovalPort</Physical>
    </Port>
    </Ports>
</Orchestration>

Send Port

<OneWaySendPort>
    <Name>PhysicalSndOrderApprovalPort</Name>
    <PortName>PhysicalSndOrderApprovalPort</PortName>
    <SendPipeline>
    <Name></Name>
    <Data></Data>
    </SendPipeline>
    <Dynamic>false</Dynamic>
    </OneWaySendPort>
</OneWaySendPorts>

MessageType

<MessageInstances>
    <SingleMessageInstances>
    <SingleMessageInstance>
    <Name>OrderRequestType</Name>
    <Properties>
    <Property>
    <Name>ID</Name>
    <xpath>/*[local-name()='OrderRequest' and namespace-uri()='http://BizMockTest.OrderRequest']/*[local-    name()='ID' and namespace-uri()='']</xpath>
    </Property>
    </Properties>
    <ContextProperties />
</SingleMessageInstance>

Sample Message

<Artifacts name="Artifacts" appName="BizMockTest" >
<MessageInstanceArtifacts>
<MessageInstance>
    <Name>SampleOrderRequest</Name>
    <Type>OrderRequestType</Type>
    <Files>
    <File>OrderRequest.xml</File>
    </Files>
</MessageInstance>

Etc.

Note: If a field is required in the Artifacts.XML, ALL values ​​should be set, otherwise the translation of the Xml using the T4 template is not properly carried out which will lead to strange errors that are difficult to ‘debug’ (look out for the Dynamic port!).

After configuring the Artifacts.Xml the ‘TextTemplatingFileGenerator’ can be started. Verify by clicking on the file that Artifacts.TT TextTemplatingFileGenerator linked. Right-click on the TT file and choose Run Custom Tool "and then the full Artifacts.CS file should be generated.

clip_image005

clip_image006

To create tests I suggest you look carefully at the example in the BizMock samples, below an example of my tests;

clip_image008

After running the test, you can use the debugger as would be possible when running orchestrations;

clip_image010

In the Message Flow you can see that the BizMock adapter is used to BizMock send the message!

clip_image012

Conclusion: BizMock is a pretty cool tool and I highly recommend to use it. For now I am anxious to see the promised upcoming DSL tool as it would enable us to use it also in rather complex projects. The lack of documentation (on the site at least) is what makes it unclear for me if BizMock can be used in combination with Custom pipelines that requires properties to be set, ESB Toolkit scenarios with itineraries etc.

To test maps and schemas BizUnit provides more than enough possibilities, however the capabilities are very promising. I hope to be able to get an update from the developer to see what possibilities are for using BizMock in conjunction with the ESB Toolkit.

Still, I think this tool is brilliant and really suggest to take a look at it!

Tuesday, August 16, 2011

Command shell – shortcuts

I’ve visited the Daydays and there was mentioned that Scott Hanselman was superior in his knowledge of tools and shortcuts. I was particularly interested in the shortcuts he used in the command shell….

Finally today I decided to look it up and found 2 I will regularly use;

ALT+SPACE+E+K <-- for copy . and
ALT+SPACE+E+P <-- for paste.

 

Hth,

Sander

Tuesday, June 07, 2011

MSMQ Dynamics Sendport – TimeToReachQueue not Infinite

When using a Dynamics MSMQ SendPort, be aware to set the TimeToReachQueue to a higher value then 0! I had created an Itinerary and could not see any messages…It turns out that the TimeToReachQueue interval is somehow ignored when using Dynamic MSMQ send ports.

If the interval specified by the TimeToReachQueue property expires before the message reaches its destination, Message Queuing discards the message in one of two ways. If the message's UseDeadLetterQueue property is true, the message is sent to the dead-letter queue. If UseDeadLetterQueue is false, the message is ignored.

In my case the solution was to set the interval to a higher value than 0, otherwise the message has to be submitted to the queue very quickly! (I noticed this only during bulk/stress-testing so I might slip you attention!)

MessagesLost

http://msdn.microsoft.com/en-us/library/system.messaging.message.timetoreachqueue.aspx

http://www.44342.com/BizTalk-f20-t14495-p1.htm

Cheers,

Sander

 

Sunday, June 05, 2011

Configuring ESB Portal resubmit

When setting up the ESB Portal we didn’t see the receive ports. After some digging around it seems that the content type is not correctly set resulting in not showing up the available receive locations.

A minor change in the SP solves this problem…

Modify the Stored Procedure: EsbExceptionDb.usp_insert_Message 

IF (@ContentType = 'text/plain' AND LEFT(@MessageData,1) = '<')
BEGIN
SET @ContentType = 'text/xml'
END



 



See the very useful post on the BizTalk forum



 



HTH,



Sander Nefs

Thursday, June 02, 2011

MSMQ with ‘Authenticate’ enabled for communicating with Dynamics AX

Hereby my findings on how to communicate with a remote MSMQ with the ‘Authenticate’ property set (required for Dynamics AX MSMQ inbound Channels).

There are 2 ways how MSMQ (4+) works, either in workgroup mode (when you only install MSMQ) or in active directory mode (when you choose 'Directory Integration').

The Logon Info only works when you work in workgroup mode. When you set the 'Authenticate' flag on the Queue the Logon Info is useless...implicitly you are using personal user certificates that are installed when you logon to the machine.

image

So my issue was resolved once i got it working with the certificates, although i would expect that the Logon Info should work hereby my resolution:

- Logon to the client machine where the Send port is defined using the Host instance account

- Open Features\MSMQ\Properties

image

- Go to the tab 'User Security'

image

- Click on 'Register' to Register the public part of the certificate in the active directory (this is the public certificate used during user validation)

- Click on 'Renew' to install the private part of the certificate in the local machine

image

- Repeat these steps on each machine the user is involved on (e.g. Server/Client)

When sending a message from the client machine the private part of the certificate is used to determine the public certificate in the active directory, this makes the MSMQ server trust the user so that the message is written in the queue using the correct authentication.

image

Some useful resources:

post from John Breakwell

MSDN

Some errors/solutions

Message was rejected

Message Queuing could not authenticate a message sent to queue ‘…….’. The message was rejected because the queue only accepts authenticated messages. It is possible that sender did not sign the message, or signed it with a self-signed certificate. A negative arrival acknowledgement will be sent if requested by the sender. This event is logged at most once per 600 seconds. To change this setting, set \HKLM\Software\Microsoft\MSMQ\Parameters\Event2195 registry value to desired time in seconds.

Cause: ‘Authenticate’ is checked on the queue, however the internal certificate does not match the public key in the active directory / MSMQ certificate store.

Solution: Renew Internal certificaat

CryptoGraphic function failed

The adapter failed to transmit message going to send port "SendPort1" with URL "FORMATNAME:DIRECT=OS:…". It will be retransmitted after the retry interval specified for this Send Port. Details:"A cryptographic function failed.".

Cause: ‘Authenticate’ is checked on the queue, however the certificate is not correctly registered.

Solution: Execute the procedure voor the certificate registration.

 

 

Cheers,

Sander

Sunday, May 08, 2011

BizTalk ESB Dynamic port – 3 filter properties

This is a quick post for you (and me!) to remember….whenever you want to use the ESB Toolkit and are wondering which filters you need to set to be able to get the send port to send a message….

SET THESE 3 FILTERS:

  • Microsoft.Practices.ESB.Itinerary.Schemas.ServiceName

Make sure that the name of this filter matches the Dynamic Send port that you have chosen in you itinerary!!

  • Microsoft.Practices.ESB.Itinerary.Schemas.ServiceState

To ensure that the process continues and that the itinerary is continued…set the state to ‘Pending’. The Toolkit will worry on the actual states.

  • Microsoft.Practices.ESB.Itinerary.Schemas.ServiceType

Depending on the scenario you can set the ‘ServiceType’ to ‘Messaging’ for a messaging based subscriber or to ‘Orchestration’ for an Orchestration based subscriber.

Filter

Note: the IsRequestResponse property might be useful for solicit response port.

 

HTH,

Sander

 

Tags van Technorati: ,,

Saturday, May 07, 2011

ESB Portal – powershell error on 64-bit machine

Yesterday I was having an issue when trying to install the ESB management portal. Although I opened the gates security wise I still got PowerShell errors…

Error_SetPolicy

I could not figure out what the problem was….then my colleague Tomasso Groenendijk asked….”is it a 64-bit machine? Good luck with that!”

64bit

It was so simple, kuch, (if you would think of it)….configure this for 32-bit AND 64-bit.

a) Start PowerShell 32-bit

image

  • Right click and choose ‘Run as Administrator’)
  • Execute the following command:

Set-ExecutionPolicy RemoteSigned

a) Start PowerShell 64-bit

image

  • Right click and choose ‘Run as Administrator’)
  • Execute the following command:

Set-ExecutionPolicy RemoteSigned

 

Hope this helps someone….

 

Sander

Tags van Technorati: ,,