.NET, BizTalk, ESB, AZURE, IoT, Python

Category: BizTalk (Page 2 of 18)

Restart Host cmd script

After deploying BizTalk solutions it is best to recycle the host instances. Normally these are recycled serial. This script will recycle them in parallel by executing them in separate cmd’s.

start net stop btssvc$biztalkserverapplication 
start net stop BTSSvc$BizTalkServerApplicationBulk 
start net stop BTSSvc$BizTalkServerMSMQ 
start net stop BTSSvc$BiztalkServerReceive
start net stop BTSSvc$BizTalkServerReceiveBulk 
start net stop BTSSvc$BizTalkServerReceiveSingleServer
start net stop BTSSvc$BizTalkServerSend
start net stop BTSSvc$BizTalkServerSend32
start net stop BTSSvc$BizTalkServerSendBulk
start net stop BTSSvc$BizTalkServerSendSingleServer
start net stop BTSSvc$BizTalkServerTracking 

timeout /t 10

start net start btssvc$biztalkserverapplication 
start net start BTSSvc$BizTalkServerApplicationBulk 
start net start BTSSvc$BizTalkServerMSMQ 
start net start BTSSvc$BiztalkServerReceive
start net start BTSSvc$BizTalkServerReceiveBulk 
start net start BTSSvc$BizTalkServerReceiveSingleServer
start net start BTSSvc$BizTalkServerSend
start net start BTSSvc$BizTalkServerSend32
start net start BTSSvc$BizTalkServerSendBulk
start net start BTSSvc$BizTalkServerSendSingleServer
start net start BTSSvc$BizTalkServerTracking

Check the naming of the services en restart!

Starting all EDI batches

When you are using the EDI batching functionality for outgoing messages in the BizTalk platform, it can be an effort to start all the batching for an environment.

The batching is located in the BizTalk EDI Application:

This is included with the BizTalk server installation as an extra option. The application consist of 4 orchestrations and receive and send locations:

With this you need to configure the batching on the agreement in the party configuration. Here are a few links how to do just that:

Batching Outgoing EDI Messages
BizTalk 2010 EDI Batching Tutorial
All you need to know about Outbound EDI Batching

The only thing is that you have to start every batching from the EDI agreement party configuration. And that can be frustrating…. Especially when you have some 20 batches to be started for a release. So I created a script to do just this. Start all batching for all agreements that have batching. And here it is:

DECLARE @BatchIdNew BigInt,
@BatchName nvarchar (256),
@ReceiverPartyName nvarchar (256),
@SenderPartyName nvarchar (256),
@AgreementName nvarchar (256);

SELECT Id, Name,
(SELECT [Name] FROM [tpm].[Partner] WHERE [PartnerId]=(SELECT [PartnerId] FROM [tpm].[BusinessProfile] WHERE [ProfileId]=(SELECT [ProfileId] FROM [tpm].[BusinessIdentity] WHERE Id=(SELECT [ReceiverId] FROM [tpm].[OnewayAgreement] WHERE Id=BatchDescription.[OnewayAgreementId])))) AS ReceiverName,
(SELECT [Name] FROM [tpm].[Partner] WHERE [PartnerId]=(SELECT [PartnerId] FROM [tpm].[BusinessProfile] WHERE [ProfileId]=(SELECT [ProfileId] FROM [tpm].[BusinessIdentity] WHERE Id=(SELECT [SenderId] FROM [tpm].[OnewayAgreement] WHERE Id=BatchDescription.[OnewayAgreementId])))) AS SenderName,
(SELECT [Name] FROM [tpm].[Agreement] WHERE [SenderOnewayAgreementId]=BatchDescription.[OnewayAgreementId]) AS AgreementName
FROM [BizTalkMgmtDb].[tpm].BatchDescription
FETCH NEXT FROM c into @BatchIdNew, @BatchName, @ReceiverPartyName, @SenderPartyName, @AgreementName;


EXEC [BizTalkMgmtDb].dbo.edi_CreateControlMessage_Activate @BatchId=@BatchIdNew,@EdiMessageType=1,
FETCH NEXT FROM c into @BatchIdNew, @BatchName, @ReceiverPartyName, @SenderPartyName, @AgreementName;


You will run this on the management database of BizTalk, and all your batching will be started. Good luck!

Batch Id xxx not found. Check if batch and party exist. (Microsoft.BizTalk.Edi.Shared)

I had this error when starting a batch from an agreement from the BizTalk admin console. (Batching of outgoing EDI messages is supported in BizTalk.  Here is a good example how to use the BizTalk batching) There were 2 things you can try for this.

  • Let the SQL sysadmin try to start the batches
  • Try to import the parties again.

Very strange but when the parties were imported again, I could start the batching.


This is the complete error:

TITLE: BizTalk Server Administration

Exception has been thrown by the target of an invocation. (Microsoft.ManagementConsole)


Batch Id 27 not found. Check if batch and party exist. (Microsoft.BizTalk.Edi.Shared)

The columns Status and YYY are either duplicated or not in a sequence. Each column can only be selected one time, and columns must be selected in sequence. (wcf-custom adapter)

This error occurred on the production environment of a customer when using a view and the wcf-custom adapter with sql-binding.

<ns0:NACK Type="NACK" xmlns:ns0="http://schema.microsoft.com/BizTalk/2003/NACKMessage.xsd">
<ErrorDescription>Microsoft.ServiceModel.Channels.Common.XmlReaderGenerationException: The columns A and B are either duplicated or not in a sequence. Each column can only be selected one time, and columns must be selected in sequence.
at Microsoft.Adapters.Sql.SelectBodyWriter.OnWriteBodyContents(XmlDictionaryWriter writer)
at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfMarshaller.CreateBizTalkMessageStream(Message wcfMessage, IAdapterConfigInboundMessageMarshalling config, TLConfig tlConfig, RLConfig rlConfig)
at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfMarshaller.CreateBizTalkMessage(IBaseMessageFactory messageFactory, IAdapterConfigInboundMessageMarshalling marshallingConfig, Message wcfMessage, TLConfig tlConfig, RLConfig rlConfig)
at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfClient`2.RequestCallback(IAsyncResult result)</ErrorDescription>

The first solution after googling was to define the columns in the request xml so the order is explicit as stated in Sandro’s blog. This resulted in the same error. Connecting the staging environment to the production server gave no errors, and connecting BizTalk production to the staging database again gave the same error.

Only the production machine gave the error….

For BT2013r2 this was a known issue: “FIX: The element orders in the schema generated by WCF-SQL adapter are different for SQL Server 2012 and SQL Server 2014

After some digging we noticed that the CU1 was installed on all environments except…… the production… After installing there were no more problems with the column order. So if you encounter this problem check if the CU is installed correctly.

cu1 2013 r2

Find more info about the CU here.

« Older posts Newer posts »

© 2021 venneker.net

Theme by Anders NorénUp ↑