Wrong Public Key Token in BizTalk message - how to change or fix

560 views Asked by At

First off, pretty new to BizTalk (here 2006) and just thrown in the cold water.

Here is the background: Updated a schema and deployed it with a wrong Public Key Token. An orchestration used to send out invoices then created an error message as follows.

Inner exception: Received unexpected message type 'NevsSchemas.lt_invoice, NevsSchemas, Version=1.0.0.0, Culture=neutral, PublicKeyToken=33796310301beca5' does not match expected type 'NevsSchemas.lt_invoice, NevsSchemas, Version=1.0.0.0, Culture=neutral, PublicKeyToken=ef01f6a8aeff3082

The only problem seemed to be the different token, as it has now the correct token (ef01...) and works again.

Problem is, I have 114 invoices sitting there in suspended mode, and it appears the message contains the wrong token (3379...) and does not update with the new (corrected) schema, as it ust tries to use the same message.

Is there an easy way to resume all 114 instances and make them go through?

Two ideas that came to mind:

  1. Change the message in the Biztalk DB and replace the token value. But since it is all compressed it's probably a bigger headache than number 2.
  2. Copy and paste the message content in a new XML file, which then gets picked up by the receive port and processed properly. We tested and that is a working option, but doing that 114 times?
2

There are 2 answers

2
Dijkgraaf On

There is an option in BizTalk Health Monitor to terminate messages, but to also save them out at the same, then you can drop them through the receive location again.

0
Nick Heppleston On

It looks like you are going to need to get your hands dirty with some code to pull the message bodies from the Suspended Message Instances.

This can be done via the BizTalk Terminator Tool or alternatively, via some WMI code. There is a helpful post at http://blogs.msdn.com/b/biztalknotes/archive/2013/05/22/saving-suspended-messages-using-wmi-powershell-and-the-microsoft-biztalk-operations-assembly-part-i.aspx that shows the relevant tricks.

Once you have extracted the messages and re-processed them, make sure that you terminate the suspended instances via the BizTalk Admin Console.