Monday 14 September 2015

Custom Pipeline to remove Unknown/Unwanted/ Characters from Incoming XML message in Biztalk.

Hi Friends,

I got a requirement where I was receiving a incoming xml message from client, that I had to process in Biztalk.

But when we received that message what we found that there was some unknown characters was added as header in that xml file. because of that files were failing at pipeline level. 

Due to some limitations client was not able to remove that header. So I had one option to use custom pipeline to remove that extra unwanted characters and make a valid xml message.

This is my scenario but you can take this example as reference for your requirement if you have:

First I will Show you the incoming message what I was getting from client:























This is my input message. in this message the part I have highlighted from Yellow color is the Unwanted characters which has been added as Header.

The part which is not highlighted, is the actual message what I suppose to receive.

The actual message will be like below snapshot:












Solution:

I will paste the complete code down, but before I would like to give a brief details what I am doing in that code.

Please note its my solution for my requirement specific to me:

I am searching for the position of string <?xml in the incoming message and wherever I am getting that string I am removing from index 0 till that position of <?xml. This I am using at Decode level in custom pipeline.

Here is my code below:






Steps To use this pipeline:

1.Sign in the DLL.
2.Register the DLL in GAC
3.Copy the DLL to Biztalk pipeline component folder.


Thank you for reading this.

Anshu Kumar






No comments:

Post a Comment