Home Page › Forums › BizTalk 2004 – BizTalk 2010 › How to handle response messages you don’t want? › Re: How to handle response messages you don’t want?
Thanks again! 🙂
About the custom pipeline component:
That’s what I did, indeed 😉 But I keep on getting that error… It’s strange though, because I find the same information when I google a bit for the problem. It seems there must be something else wrong with my piece of code? When I step through the code (debug it), it gives no errors. But when I check the eventlog afterwards, I get the “object reference not set to an instance of an object” errors…
Here’s the piece of code I’m using:
public Microsoft.BizTalk.Message.Interop.IBaseMessage Execute(Microsoft.BizTalk.Component.Interop.IPipelineContext pc, Microsoft.BizTalk.Message.Interop.IBaseMessage inmsg)
{
string messageTypeIncomingMessage = “”;
object oMessageType = inmsg.Context.Read(“MessageType”, “http://schemas.microsoft.com/BizTalk/2003/system-properties“);
if (oMessageType != null)
{
messageTypeIncomingMessage = (string)oMessageType;
messageTypeIncomingMessage =
messageTypeIncomingMessage.Substring(messageTypeIncomingMessage.IndexOf(‘#’) + 1);
}
// Make sure the properties aren’t null and the messageType was found
if (!String.IsNullOrEmpty(messageTypes)
&& !String.IsNullOrEmpty(messageTypeIncomingMessage))
{
String[] messageTypesArray = messageTypes.Split(new char[] { ‘;’ }, StringSplitOptions.RemoveEmptyEntries);
// Loop all elements to check if the message needs to be ignored
for (int i = 0; i < messageTypesArray.Length; i++)
{
string messageTypeFromArray = messageTypesArray[i];
if (messageTypeIncomingMessage == messageTypeFromArray)
{
// messageType was found -> message needs to be ignored
return null;
}
}
}
return inmsg;
}
About the null adapter:
Thanks a lot for the information about the 64-bit systems! This adapter works like a charm and does exactly what we need it to do! Great! 🙂