Binary Messages in BizTalk

In a current project I work with Binary Messages in BizTalk Orchestration (received by WebService, sent with dynamic SMTP Adapter). To get to know more about the topic the following ressources where extremely useful:

MIME Encoder is missing 64bit Support

Recently I used the mime encoder in a custom pipeline and got an error when sending a message through the pipeline at runtime:

There was a failure executing the send pipeline: ........................
Reason: Retrieving the COM class factory for component with CLSID {254B4003-2AA7-4C82-BB2E-18BA7F22DCD2} failed due to the following error: 80040154

After some time I figured out that this was because the send port run under a 64bit Host Instance. I changed it to 32bit and it worked. Obviously MimeEncoder does not support 64bit - this is also stated in BizTalk Documentation:

http://msdn.microsoft.com/en-us/library/aa578427(BTS.10).aspx
http://technet.microsoft.com/en-us/library/aa560166(BTS.10).aspx

 

Specify multiple schemas in document schema property field of XMLReceive Pipeline

Last week I had the following problem: I published two orchestrations (with different input schemas) as WebService. The client application which of course used the same two schemas was also a BizTalk application and run in the same group. I had no influence on that and therefore the problem of duplicate schemas occured.

So I had one Receive Location for the two orchestration and needed to specify the "Document Schema"  property to tell the XMLReceive pipeline which of the deployed schemas it should take. Indeed very simple but I had to search a bit: You can add two or more schema declarations in the property field seperated with the pipe(|). It worked like a charm without a problem.

BizTalk + Visual Studio Team System + Unit Test Project = ??

The combination of a Team System solution, including a BizTalk project and an Unit Test C# project is not a good one, as I learned recently. ;-)

The problem occured, when I wanted to add a BizTalk map in an orchestration - simply nothing happened. The only thing was an bunch of errors while closing Visual Studio afterwards:

---------------------------
Microsoft Visual Studio
---------------------------
Unexpected error encountered. It is recommended that you restart the application as soon as possible.
Error: HRESULT: 0x80131527
File: vsee\internal\inc\vscomptr.inl
Line number: 473
---------------------------
OK  
---------------------------
Another error was the following one:

---------------------------
Microsoft Visual Studio
---------------------------
Error
COM object that has been separated from its underlying RCW cannot be used.
---------------------------
OK  
---------------------------

After unloading the Unit Test project everything worked fine again.

Magic 65536

Today I managed to get a strange Error (like you get it in Excel if you have more than the famous 65536 rows) during BizTalk testing with HAT. :-)

HAT Error

I suppose the reason is that HAT (where I displayed some debugging data) uses Office WebComponents in background and therefore this limitation is causing problems with greater amounts of data. Anyway an interesting error.

Generate well formed XML out of a BizTalk map

A property of a BizTalk map that I didn't know before: Ident (to generate well-formed XML out of a map)

Thanks to Erika Ehrli for further information: http://blogs.msdn.com/erikaehrli/archive/2005/11/16/IndentXMLFilesandDocuments.aspx  

Strange FTP Adapter Error

Recently I got these two errors with EventID 5740 from a FTP Receive Location:

  • The adapter "FTP" raised an error message. Details "WARNING: An unexpected failure occurred when attempting to disconnect from the remote FTP server. The error code was 0x8004200C ".
  • The adapter "FTP" raised an error message. Details "A failure occurred when parsing the remote folder listing. ".

The strange behaviour was that BizTalk got alle files from the Receive Location, succesfully processed it and after some minutes the Receive Location was shut down.

I finally found out that there problem was a problem with the file mask - after changing the mask from *.xml to *.* (which was ok in my case) it worked without problems. But don't ask me for the reason - I have to admit I don't know. Perhaps I will find some time to do further investigations....

    Network Config Vista

    One of the things that are a great pain for me in Vista is the way to get to the Network Connections Screen. Although it's a small detail I think this is a real deterioration for IT Professionals who do a lot of work with network connections. (changing IP Adresses, DNS Servers, etc.) In Windows XP you could get to the IP Config Dialog quickly with a Double Click on the network connection - Now you have to navigate over the Network Sharing Center OR ....

    you can use this command in the Search Field: ncpa.cpl (Source: http://blogs.technet.com/migreene/archive/2008/04/26/3045418.aspx)

    SQL Adapter Links

    Recently I have done some work with the BizTalk SQL Adapter. I collected the following Links out of the Blogs of Richard Seroter and Stephen Kaufman which are perfect (excellent content) for getting a better understanding of the work with updategrams:

    Update: Another userful Link:

    Error: "Attempted to access an unloaded AppDomain"

    Today I encountered the following error after changing a value in a web.config file of a published webservice on two nodes of an NLB cluster

    "Attempted to access an unloaded AppDomain"

    After the web.config change all web service requests failed. The solution was to reset the IIS and restart the corresponding BizTalk Hostinstance. (although I think restarting IIS should have been enough) The interesting thing was that another application, running under the same AppPool also had the same error.

    Update: See this Link http://technet.microsoft.com/en-us/library/aa577833.aspx for a describtion and resoltution of the problem.

    Set Advanced Transport Properties dynamically

    Sometimes when using dynamic ports, you also need properties from the advanced transport properties tab. These are the ones I have already used:

    • BizTalkMessage(BTS.RetryCount) = 5 (Specifies how often sending on the port is retried)
    • BizTalkMessage(BTS.RetryInterval) = 5 (Specifies how many minutes to wait before the next retry)
    • BizTalkMessage(FILE.CopyMode) = 0 (Specifies the behaviour when copying files: 0 = append, 1 = create, 2 = overwrite)

    CData Sections in BizTalk Orchestration

    Recently I worked for the first time with CData sections in XML messages. A CData section in an XML Document starts with <![CDATA[ and ends with ]]> and everything between is ignored by the XML parser.

    In my scenario I got xml (with some CData sections) from a WebService, transformed it with a map (and did some other things in an orchestration) and sent it to another WebService. The first WS gave me xml with CData but the second WS received none.

    After some debugging I found out that the xml arrived in the orchestration in the correct format (with CData sections). The place where the CData got lost was the map. The CData brackets where simply omitted during transformation. I found that there is a property called "CDATA Section Elements" at the map. (you get it in your property window if you click on the space in the middle in Biztalk mapper where you drop functoids) There I entered a xml node and after the transformation this node contained a CData Section. I was especially happy because this node was part of an any element in my xml message. Although the mapper does not know the schema of my whole message he inserted the CData section in the subnode.
    The last question was how to specify more than one node to be CData nodes. I tried with comma and semicolon but only got errors when testing the map. After investigating the depths of BizTalk documentation I found the section where the "CDATA Section Elements" property is described and found the required information in the last sentence. :-)

    "If you provide multiple values for this property, separate them with spaces."

    Now I was able to finish the application correctly. The only interesting question left (but had no time to test it) is if there is a way to automatically recognize CData sections in an inbound document of a map and dynamically create the CData sections in the outbound document. (perhaps with a custom functoid) But that would be a seperate post in the future, since the current solution is sufficient for me.
     

    Redeploy Pipeline Components

    When you try to redeploy Pipeline Components BizTalk locks the dlls under C:\Program Files\Microsoft BizTalk 2006\Pipeline Components. They are locked by the BizTalk Host Instance that used them. To update a Pipeline Component one has to stop the Host Instance, redeploy and then start the Host Instance.  

    UPDATE: Thanks to Th Almeida who pointed me to this: Pipeline Components are locked by the host that is using the pipeline not by the standard host. I did my pipeline deployment test with a dynamic port and NTLM authentication which means that the pipeline gets executed under the standard host.  (I have already corrected this in the abouve blog statement to prohibit confusion)   

    Specify how Credentials are used in Dynamic SOAP Messages - Part 2

    Short Update to my previous post about this:

    Setting the AuthenticationScheme to NTLM means that the user of the host instance is sending the message to the destination. In case of a dynamic port there is no host specified - BizTalk then automatically executes the dynamic Send Port under the standard host user. (for example BizTalk Server Application)

    Interesing BizTalk Pitfall

    Today I faced a really interesting problem when redeploying a BizTalk application:

    In an orchestration I map the Response of a WebService call together with another message to an outbound message. Everything went fine until I changed the WebService. I put the WebMethod into another WebService (called method and return parameter remained the same as before), deleted the whole webreference, added the webreference to the new WebService and changed the types of my Webservice request and response messages to the new webmessagetypes. After a successfull rebuild a deployed it without an error.

    When starting a test I stepped through the process with orchestration debugger and discovered that the WebService successfully returned data but the Outbound message was empty. (the part that originated from the WebService)

    Some investigation showed me that in Visual Studio the maps input type still pointed to the namespace and the node of the old WebService. But there was no build error or warning since the the type of the WebService response message was the same as before. There also was no error when running the process - the map simply did not copy data in the destination message because it found no corresponding namespace in the source message.

    Such a case can be tricky because there is no error or hint that something is wrong. The map also does not indicate that there was a change of the webservice response.

    Specify how Credentials are used in Dynamic SOAP Messages

    When calling a WebService from BizTalk, beside specifying Username and Passwort, one has to set the form of authentication (Anonymous, Basic, NTLM, etc.) too. This can be done either on the Sendport Configuration or - when using a dynamic port - by the following code (example for using NTLM = Windows Integrated Authentication) in an expression shape:

    MessageName(SOAP.AuthenticationScheme) = "NTLM";

    Experiences with BizTalk Webpublishing Wizard

    Today I worked on a BizTalk project where I have two Orchestrations in one BizTalk Project and I want to publish them as WebService. There are some things to consider when publishing WebServices:

    • To publish an orchestration the orchestration's receive porttype has to be public. (Don't make the orchestration itself public)
    • If you have already deployed one Orchestration to BizTalk and after that you develop a new orchestration (not deployed), you don't see the second orchestration in the Publishing Wizard's orchestration list. Although you choose the assembly manual from the file system the wizard looks if there is an assembly with the same name and version in the gac. If this is the case he will take the gac assembly.
      Redeploy the orchestration and it will work.
    • Another interesting behaviour is an invalid generation of the proxy WebService. One of my two orchestrations required an input message that consisted of a root node and one child. (type: string, occourence: 1 to unbounded) The publishing wizard successfully generated my webservice but calling it fails. Opening the solution and building up ends up in an error. (type of the RequestMessage is not found)
      I finally found out that everything works fine when I add a further node between the root node and the child string in my input message in the orchestration. After that I started the publishing wizard again and it worked fine.  

    Cool Beta Software

    Recently I came across two nice pieces of beta software:

    Ajax / Atlas Ressources

    Some intersting Links about Ajax or Atlas Ressources:

    https://blogs.conchango.com/andrewbritcliffe/archive/2006/06/06/4038.aspx

    BigDays 2006 (Vienna):
    There was an Atlas session I attended an at the bottom of the link below there is a download of the slides. Additionally there are common Q&A that where asked during the presentation.
    http://www.microsoft.com/austria/events/bigdays/downloads.mspx

    PocketPC Development

    I have recently developed a little Pocket PC Applikation with Visual Studio 2005. The App's purpose was to call WebServices but I had some Beginner problems establishing an Internet Connection with the VS Pocket PC Emulator until I found the following Blog Entry: http://blogs.msdn.com/vsdteam/archive/2005/10/07/478295.aspx

    It helped me to establish an Active Sync Connection between my Virtual Operating System an the VS2005 Emulator and afterwards a successfull Internet Connection.

    BizTalk 2006 R2

    BizTalk 2006 R2 is scheduled for June 2007, there will be some interesting features:
    http://geekswithblogs.net/ajames/archive/2006/06/09/81287.aspx

    Best of all: RFID Support
    http://www.ddj.com/dept/windows/188702267?cid=RSSfeed_DDJ_Windows/.NET

    BizTalk News

    Some News and Information regarding BizTalk 2004 and 2006:

    -         Understanding BizTalk2006 Document: http://www.microsoft.com/biztalk/techinfo/whitepapers/understanding.mspx

    -         Not a BizTalk topic but related to some extent ist he following white paper about the Business Value of RFID from Microsoft: http://www.microsoft.com/biztalk/techinfo/whitepapers/rfid.mspx

    -         Slides and Code Samples from Marty Wasznicky’s BizTalk 2004 Commando Training Course à very high quality(!!) http://blogs.msdn.com/martywaz/archive/2005/06/06/425945.aspx

    -         First Look on BizTalk 2006 for IT Pros and Developers:

    o        https://www.microsoftelearning.com/eLearning/offerDetail.aspx?offerPriceId=77178

    o        https://www.microsoftelearning.com/eLearning/offerDetail.aspx?offerPriceId=78008

    -         Some Presentations from Austrian BizTalk Events:

    o        Partner Technical Community about BizTalk 2006: http://www1.microsoft.at/includes/Image.aspx?type=1&dl&ID=18038

    o        Technet Briefing about BizTalk 2006: http://www1.microsoft.at/includes/Image.aspx?type=1&dl&ID=18059

    o        Technet Briefing Case Study: http://www1.microsoft.at/includes/Image.aspx?type=1&dl&ID=18058

     

    Web Service Debugging:

    Debugging of WebServices often is not easy but there are some tools helping you with that. I found two interesting ones:

    -         SOAP Sonar: http://www.crosschecknet.com/

    -         AmberPoint Express for Visual Studio 2005: http://express.amberpoint.com

    New Features in BizTalk 2006

    Today I did a short research on the new features of BizTalk 2006 with the help of www.microsoft.com:

     

    • Improved Setup Process (simplified for beginners – “single account installation”, more flexible for advanced users – “server farm installation”)
    • Seamless Upgrade installation from BT 2004 to 2006 possible
    • BizTalk Application Concept: Logical container in Administration for all objects regarding a BizTalk solution
    • BizTalk Application Packaging: One msi file for a whole BizTalk solution
    • Enhanced Admin Console (create messaging components, …)
    • New health monitoring tool: Better overview of running orchestrations at a glance
    • Enhanced BAM (BAM portal, new WS-Interfaces, BAM alerts)
    • Orchestration Zoom
    • Flat File Wizard (no manual Flat File generation à generate XSD out of FlatFile Instance)
    • New BT adapters (POP3, Sharepoint, MQ Series)
    • Failed Message Routing (subscribe to suspended messages)
    • Enhanced Message Recovery Capabilities
    • Large Message Transformation (stored not only in RAM but in FileSystem)

    Calling or starting Orchestrations

    Today I worked with the BizTalk Shapes Call and Start Orchestrations. In German they have the silly names "Aufruforchestration" and "Start Orchestration" which do not express their purpose. I found to really good blog entries about this topic:

    http://dallas.sark.com/SarkBlog/mholdorf/archive/2005/10/12/2183.aspx
    http://www.topxml.com/BizTalk-Rule-Engine/re-2671_Processes-for-invoking-BizTalk-orchestrations-both-synchronously-and-asynchronously.aspx

    Also a fine example from Scott Woodgate exists. (See at end of second link)

    Short hint: If you call an orchestration from another project you have to set the Type Modifier Property to public. Otherwise the orchestration will not show up in the dialog where to choose the orchestration you call.

    Usefull BizTalk Infos

    Some usefull hints for BizTalk Developers, I found out during BizTalk development during the last weeks:

    «November»
    SunMonTueWedThuFriSat
    25262728293031
    1234567
    891011121314
    15161718192021
    22232425262728
    293012345