If we run this map in BizTalk 2010 and watch for the output in Debug View we get the expected output
Also the map test succeeds in BizTalk 2010. As shown below:
Invoking component… F:ProjectsTestMapTestMapSomeMap.btm: The compilation is using the CustomXslt and CustomExtensionXml tags to generate the output. The map content is ignored. TestMap used the following file: <file:///C:UsersAdministratorAppDataLocalTempinputfile.xml> as input to the map. Test Map success for map file F:ProjectsTestMapTestMapSomeMap.btm. The output is stored in the following file: <file:///C:UsersAdministratorAppDataLocalTemp_MapDataTestMapSomeMap_output.xml> Component invocation succeeded.
Observed behavior BizTalk 2013
If we run this in BizTalk 2013 we get the following output.
C:ProjectsTestMap2013TestMapTestMapSomeMap.btm: The compilation is using the CustomXslt and CustomExtensionXml tags to generate the output. The map content is ignored. TestMap used the following file: <file:///C:UsersAdministratorAppDataLocalTempinputfile.xml> as input to the map. C:ProjectsTestMap2013TestMapTestMapSomeMap.btm: error btm1050: XSL transform error: Unable to write output instance to the following <file:///C:UsersAdministratorAppDataLocalTemp_MapDataTestMapSomeMap_output.xml>.
Exception has been thrown by the target of an invocation. An error occurred during a call to extension function ‘WriteNode’. See InnerException for a complete description of the error. Enumeration has not started. Call MoveNext. Test Map failure for map file <file:///C:ProjectsTestMap2013TestMapTestMapSomeMap.btm>. The output is stored in the following file: <file:///C:UsersAdministratorAppDataLocalTemp_MapDataTestMapSomeMap_output.xml> Component invocation succeeded.
So the map failed because the behavior of the compiled xslt is different from the interpreted xslt.
The behavior should be the same as in BizTalk 2010.
December 22, 2010 /Comments Off on Getting rid of : WCF-Custom" raised an error message. Details "System.Data.SqlClient.SqlException: Timeout expired
I had a nice setup in my BizTalk environment. I had 4 receive locations polling for data (in the same table) and it all boiled down to execute a stored procedure with different parameters. I used the WCF adapter with SQL bindings for that. For some obscure reason, I would get timeouts in the eventlog. Below is a screenshot of the receive port setup I had. Only one is shown but I had four of them.
Some important things to notice:
PolledDataAvailablestatement, is not used cause Pollwhiledatatfound = false. But you still have to put stuff in there to make things work.
Execute a specific sproc, with the number of records you want to receive as a parameter.
UseAmbientTransaction, no, no,no, had too many problems in the past when using msdtc and receive locations (locks and stuff) so this is a NO.
ReceiveTimeout is set to 10 minutes. This is a bit long but i never touched that value, it’s the default.
To make things a little bit more clear, The stored procedure I used looks looked like this :
CREATE PROCEDURE [dbo].[Get_TeVertalen_Berichten] ( @MaximumAantal INT = NULL ) AS BEGIN EXEC [dbo].[Get_Berichten_Internal] @MaximumAantalInternal = @MaximumAantal, @OudeBerichtStatus = ‘TeVertalen’, @NieuweBerichtStatus = ‘VertalenGestart’, @Richting = ‘Ingaand’ END
And here is the code of Get_Berichten_Internal:
CREATE PROCEDURE [dbo].[Get_Berichten_Internal] ( @MaximumAantalInternal INT = 15, @OudeBerichtStatus VARCHAR(200), @NieuweBerichtStatus VARCHAR(200), @Richting VARCHAR(20) ) AS BEGIN BEGIN TRY — Declare variables DECLARE @AFFECTED_KEYS TABLE ( BerichtID NUMERIC(18, 0) ) DECLARE @AFFECTED_ROWS INT — Some sets needed SET NOCOUNT ON — Perform the update statement and capture all the keys UPDATE TOP (@MaximumAantalInternal) dbo.tb_Bericht SET BerichtStatus = @NieuweBerichtStatus OUTPUT INSERTED.BerichtID INTO @AFFECTED_KEYS WHERE BerichtStatus = @OudeBerichtStatus AND ExternBerichtTypeID IS NOT NULL AND InternBerichtTypeID IS NOT NULL AND Richting = @Richting — DO STUFF WITH THE AFFECTED KEYS <– SNIP–> END TRY END
Now everything looks good and in the query analyzer everything was working blazingly fast. But I started to see the following message in the eventlog every 10 minutes (hmm that’s the receive timeout). And sometimes several (four to be exactly) of them within a very short period of time.
Event Type: Warning Event Source: BizTalk Server 2006 Event Category: BizTalk Server 2006 Event ID: 5740 Date: 14-12-2010 Time: 10:47:07 User: N/A Computer: BA34T Description: The adapter “WCF-Custom” raised an error message. Details “System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. at Microsoft.ServiceModel.Channels.Common.Design.AdapterAsyncResult.End() at Microsoft.ServiceModel.Channels.Common.Channels.AdapterInputChannel.EndTryReceive(IAsyncResult result, Message& message) at System.ServiceModel.Dispatcher.InputChannelBinder.EndTryReceive(IAsyncResult result, RequestContext& requestContext) at System.ServiceModel.Dispatcher.ErrorHandlingReceiver.EndTryReceive(IAsyncResult result, RequestContext& requestContext)”.
And once this message started to appear, stuff went downhill from there on. I could see in the profiler that stored procedures were taking ages, and even simple updates of a single record would take thirty seconds or so. Lock-Time-outs and deadlocks were occuring on a very regular basis. Even though the receive locations werent receiving any data. So nothing was received and I still got may daily portion of errors/warnings/suspended stuff in BizTalk because of this. So basically it looked like I was having some kind of locking problem even if no work was done by the second stored procedure. But the second procedure did an update (even when there was nothing to update) and maybe that triggered the nasty behaviour.
I started a discusiion on MSDN to see if anybody could help : <<See here>>
But eventually i cghanged something to make this behaviour go away. The idea was only to perform the update when there was stuff to update. So i changed the first procedure to :
CREATE PROCEDURE [dbo].[Get_TeVertalen_Berichten] ( @MaximumAantal INT = NULL ) AS BEGIN SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED DECLARE @Aantal int SELECT @Aantal=count(*) FROM dbo.tb_Bericht WITH (NOLOCK) WHERE BerichtStatus = ‘TeVertalen’ AND ExternBerichtTypeID IS NOT NULL AND InternBerichtTypeID IS NOT NULL AND Richting = ‘Ingaand’ IF @Aantal > 0 BEGIN EXEC [dbo].[Get_Berichten_Internal] @MaximumAantalInternal = @MaximumAantal, @OudeBerichtStatus = ‘TeVertalen’, @NieuweBerichtStatus = ‘VertalenGestart’, @Richting = ‘Ingaand’ END END
And by first checking if there was any work to do and only then do an update, I got rid of the deadlocks and the errors in the eventlog. I really don’t know why this solved it, but my guess is there is some bug in the WCF adapters, that go wrong if you start a transaction but return no data.
Everything is running smooth now and I hope this post will help somebody experiencing the same problems.
September 27, 2010 /Comments Off on Strange COM exception in BizTalk
A while ago I had serious problems with BizTalk. For some obscure reason the BizTalk engine would throw some XLANG errors and stop processing all messages. A restart of the hosts would fix the problem for a while but after some time the same problem would occur and BizTalk would effectively stop processing. (orchestrations would be marked as active but nothing happens)
The funny thing is, these orchestrations were deployed on the BizTalk Server a long time ago and they never gave any problem. All of a sudden these problems started to appear. So I think the blame is probably in some kb^*&^(& hotfix somewhere.
I had a case with MS-Support (and for sure they had never seen this error) and even google will not tell you that much about it. However, until now I have had two people contact me with exactly the same problem. So I know I was not alone ! Since googling on this gives me very poor results I will put some details about what happened in this post.
I have mentioned both MSDN threads that have this problem. The things we have in common are:
Usage of the classic SQL adapter
Typically, this problem occurs when the orchestration engine reaches a Call Orchestration shape or a Start Orchestration shape.
To isolate this problem we added a specific SQL Host that does all the work for the SQL Adapter. We hoped the next time we saw the error, we could see if it was caused by orchestrations or really by the SQL adapter. Cause then onlu the SQL Host would have a problem. We had everything set up to debug the BizTalk environment with the tools provided by MS and we were waiting for the event to happen. But unfortunately after we added a dedicated SQL host the problem never re-occurred. So the supportcase is closed now (without a definitive answer).
If you have had a similar experience please give a response to this post.
May 11, 2009 /Comments Off on About EDI / Property Schemas and Validate instance
In the future we need to process EDI documents so I am currently looking at some EDI Samples.
I did some tutorials (from Pro EDI in BizTalk Server 2006 Apress) and I created my own EDI schema based on X12_00401_810 (Exercise 1.0 to 1.4)
Then I had to create my own PropertySchemas to promote some nodes (Exercise 1.5)
Then I had to validate an instance of the schema i had just created….(Exercise 1.6 to 1.7)
But no matter what I did, I kept getting the same error over and over again. The errors were :
Invoking component… D:XXXSchemasX12_BatchSchema.xsd: error BEC2004: Object reference not set to an instance of an object. D:XXXSchemasX12_BatchSchema.xsd: error BEC2004: Validate Schema failed for file: <file:///D:XXXSchemasX12_BatchSchema.xsd>. D:XXXSchemasX12_BatchSchema.xsd: error BEC2004: Validate Instance failed for schema X12_BatchSchema.xsd, file: <file:///C:Apress.IntegrationChapter 1Test DocumentsValid-Input.txt>. Component invocation succeeded.
So I googled around a bit and tried to create a new solution. This has helped somebody who whas experiencing the same problems. But it Didn’t help me. The same rror keept popping up.
Only when I removed the property schema from my solution (created in 1.5) everything worked as expected. So since there is very little docuementation on this behaviour I hope this can help anybodu in the future.