Missing tracking data

Over the last few days we had increasing problems with missing and incomplete tracking data. For some interfaces we would only see the incoming or outgoing data, for other interfaces no data was being shown at all.

Inspection of the DTA table in the database showed it was missing in the database as well, so we could rule out the administration console and its queries.

After some searching, I found out the tracking events on the pipelines had been unchecked. After re-enabling these everything worked normally again. Continue reading

WCF-SQL adapter, using MSDTC cross domain

Today I had to set up the WCF-SQL adapter, to write data to a database used for BI purposes. We have our BizTalk machine located at a hoster, the BI database is located on a server on-premise at the client, and a VPN connection connects the servers. The servers are in different domains.

Generating the schemas went without problems, however once we wanted to do some actual work on the database we got the following 2 errors in the event log:

MSDTC encountered an error (HR=0x80000171) while attempting to establish a secure connection with system BIBIZ.

And

The adapter failed to transmit message going to send port “Communicate with BI” with URL “mssql://bibiz.acme.nl//bibizDatabase?”. It will be retransmitted after the retry interval specified for this Send Port. Details:”System.Transactions.TransactionManagerCommunicationException: Communication with the underlying transaction manager has failed. —> System.Runtime.InteropServices.COMException: The MSDTC transaction manager was unable to push the transaction to the destination transaction manager due to communication problems. Possible causes are: a firewall is present and it doesn’t have an exception for the MSDTC process, the two machines cannot find each other by their NetBIOS names, or the support for network transactions is not enabled for one of the two transaction managers. (Exception from HRESULT: 0x8004D02A)

It turned out, that to use MSDTC across domains you have to set some options. I will list the actions to be taken here, both for my own reference, and to help anyone else running into this problem. Continue reading

Object reference not set to an instance of an object

Okay, so the scenario is this:
–          Generated schemas from a webservice, this created a request schema, a response schema, and a schema with complex types used in the schemas
–          Two promoted fields in the response message (an error code and description)
–          An orchestration which sends out the request, receives the response, and uses a decide shape to create an email message if the response error code is something other than 0

So after deploying everything, and running a test, the orchestration got suspended with an error message like this:

xlang/s engine event log entry: Uncaught exception (see the ‘inner exception’ below) has suspended an instance of service ‘Acme.BizTalk.System.Orchestrations.ImportProduct(dcfd4fa0-976a-7a77-4aec-0b9cbc3c9200)’.
The service instance will remain suspended until administratively resumed or terminated.
If resumed the instance will continue from its last persisted state and may re-throw the same unexpected exception.
InstanceId: c0a43be3-e729-4315-9da3-15337a92c5a4
Shape name: DecideShape_CheckResult
ShapeId: f8255ab5-a462-4756-b63f-12f463806873
Exception thrown from: segment 1, progress 16
Inner exception: Object reference not set to an instance of an object.

So the problem turned out to be, the distinguished fields don’t get filled, even though the message itself looks just fine. After some digging around I found out the problem was in the Element FormDefault properties, but not just on the response message, but also on the schema which has the complex types defined. On both of these schemas, I had to set the Element FormDefault property to Qualified. After having done a new deployment, everything now works.

Identifier ‘tag’ does not exist in ‘message’

I ran into some pretty strange behavior` today in BizTalk. I use different projects in my solution for things like schemas, mappings, orchestrations, etc., the BizTalk Software Factory way so to say. For this blogpost I created a new project, which can be downloaded here.

The problem arose, when I wanted to use a distinguished field in my orchestration. I went ahead and created a new schema, created the distinguished field, built my schemas project, and finally added the assembly to the GAC (my development machine is also my test machine at this customer, so there is no way around having the assemblies in the GAC at some point).schema Continue reading

Integrating Microsoft Dynamics CRM 2011 with BizTalk 2010

As I told in my previous post, I am working at a customer where we are trying to integrate Microsoft Dynamics CRM 2011 using BizTalk 2010. Since CRM 2011 does not have a BizTalk adapter anymore, we have to use the webservices it exposes, which can be used in BizTalk in 2 ways. I first tried to use the untyped option, where you would have to use mappings with custom XSLT for your communication to the CRM service. I ran into a lot of problems with this, and then decided to use the typed option instead. Using this option, you will create a helper class that does the communication to CRM, which you can then use from your orchestrations. While looking for more resources on this, I ran into this video Peter Kelcey created, which I used as my basis for my solution. The full source for my solution can be found here.
Continue reading

Integrating CRM 2011 with BizTalk 2010 – Untyped

At one of our customers we are running a project where we are integrating various systems, among which a hosted CRM 2011 on premise. In older versions of CRM we had a BizTalk adapter which could be used to set up communication between BizTalk and CRM, however with this version this is no longer the case. Microsoft has decided integration should be done by using the new webservices CRM exposes, which sounds easier then it turned out to be.
Continue reading

Automated creating of users and groups

In my previous post I showed how I automated creating hosts and host instances. In this post I will continue on that, but then by creating the users and groups according to the BizTalk best practices. They are created on the local computer, I will see if I can adjust the script to create them in an AD at a later time. As with my last post, I have commented my code thoroughly, so it should pretty much explain itself.
Continue reading

Automated creating of BizTalk hosts and host instances

I regularly have to do new deployments of BizTalk environments. Off course I try to follow the best practices as best as I can, which means I always try to have a seperate send, receive, orchestration and tracking host. Because I don’t want to spend to much time creating these, I decided to make a PowerShell script to do this for me. I used the BizTalk PowerShell Provider to do so. This blogpost will show the code I used. I commented my code, so it should be pretty self-explanatory.
Continue reading

Deploy webservice using BizTalk Deployment Framework

In one of my projects we expose schema’s as a WCF webservice. I wanted to use the BizTalk Deployment Framework to deploy the webservice along with all the other artifacts. Start by deploying the webservice using the BizTalk WCF Service Deployment Wizard. Once finished, copy the folder for the webservice from C:\inetpub\wwwroot to your project folder. After you have added the files to your project, make sure the build action on the XSD’s is set to None instead of BtsBuild, as the references in these schemas probably can’t be resolved on build. Now you have to make a couple changes in your BTDF project file. To start with, you will have to tell that you want to deploy virtual directories, change the following property to do so:

<IncludeVirtualDirectories>true</IncludeVirtualDirectories>

After the virtual directories have been created IIS has to be restarted. Luckily, this can also be done using BTDF, by setting the SkipIISReset property.

<SkipIISReset>false</SkipIISReset>

Next you will have to specify the settings of the webservice. For this create a new ItemGroup, which should be placed under the PropertyGroup with the ProductID.

<ItemGroup>
  <VDirList Include="*">
    <Vdir>NameOfWebService</Vdir>
    <AppPool>NameOfAppPoolToRunServiceUnder</AppPool>
    <Physdir>..\NameOfWebserviceFolderYouCopiedEarlier</PhysDir>
  </VDirList>
</ItemGroup>

You will also have to specify the user credentials the AppPool will run under. I used the SettingsFileGenerator.xml file for this. Add VDIR_UserName and VDIR_UserPass to this document, and set them for your environments. Now go back to the BTDF project file, and add the following under the ItemGroup you just created.

<ItemGroup>
  <PropsFromEnvSettings Include="VDIR_UserName;VDIR_UserPass" />
</ItemGroup>

Standard, the AppPool will be running .NET2, however we want it running .NET4. In the final release of BTDF v5 there will be a new attribute on the VDirList for this, but for now we have to use a CustomPostDeployTarget.

<Target Name="CustomPostDeployTarget">
  <Exec Command="&quot;C:\Windows\System32\inetsrv\appcmd.exe&quot; set APPPOOL /apppool.name:&quot;NameOfAppPoolToRunServiceUnder&quot; /managedRuntimeVersion:v4.0 /managedPipelineMode:Integrated" />
</Target>

Now when you use the BTDF to deploy your application, it will automatically set up an AppPool and create the WCF webservice for you.