Custom component not always replacing the orginal message
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > BizTalk Server > BizTalk Server General > Custom component not always replacing the orginal message




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Custom component not always replacing the orginal message  
Al


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-28-05 07:52 AM

Hi all,

I've implemented a decoder pipeline component which replace the
original message with a new one.
the code is:

IBaseMessagePart bodyPart = inmsg.BodyPart;

rootElementName = "Root";
namespaceMessage = "http://name";

MemoryStream  outputStream = new MemoryStream();

XmlTextWriter xmlWriter    = new XmlTextWriter(outputStream,
Encoding.UTF8);
xmlWriter.WriteStartElement("ns0", rootElementName, namespaceMessage);
xmlWriter.WriteStartElement("InputFileName");
xmlWriter.WriteString("a string");
xmlWriter.WriteEndElement();
xmlWriter.WriteEndElement();
xmlWriter.Flush();

// rewind
outputStream.Seek(0, SeekOrigin.Begin);
// replace the original message
bodyPart.Data = outputStream;
pc.ResourceTracker.AddResource( outputStream );
// set the MessageType
string MessageType = namespaceMessage + "#" + rootElementName;

string systemPropertiesNamespace =
"http://schemas.microsoft.com/BizTalk/2003/system-properties";
inmsg.Context.Promote("MessageType", systemPropertiesNamespace,
messageType);


All works great if there is an orchestration for the MessageType =
namespaceMessage + "#" + rootElementName

What i dont understand is the folowing situation:
when there is no orchestration subscribed to MessageType,BTS doesn't
know how to dispatch the Message and correctly report an error.

In this case if I look in the HAT and save the message I see the
original message and not the new one wroten in
the pipeline component.
I can't understand why  the original message goes in the MessageBox
and not the new one.
Can someone explain me why this occurs?
Thanks in advance, Al





[ Post a follow-up to this message ]



    RE: Custom component not always replacing the orginal message  
Danny Buysse


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-28-05 12:49 PM

This is due to the fact that BizTalk Server is suspending messages that has
no subscription. When suspending the messages are placed into the suspended
messages table within there original format, so not like they are processed
by pipelines.

Danny Buysse
http://dannybuysse.blogspot.com/

"Al" wrote:

> Hi all,
>
> I've implemented a decoder pipeline component which replace the
> original message with a new one.
> the code is:
>
> IBaseMessagePart bodyPart = inmsg.BodyPart;
>
> rootElementName = "Root";
> namespaceMessage = "http://name";
>
> MemoryStream  outputStream = new MemoryStream();
>
> XmlTextWriter xmlWriter    = new XmlTextWriter(outputStream,
> Encoding.UTF8);
> xmlWriter.WriteStartElement("ns0", rootElementName, namespaceMessage);
> xmlWriter.WriteStartElement("InputFileName");
> xmlWriter.WriteString("a string");
> xmlWriter.WriteEndElement();
> xmlWriter.WriteEndElement();
> xmlWriter.Flush();
>
> // rewind
> outputStream.Seek(0, SeekOrigin.Begin);
> // replace the original message
> bodyPart.Data = outputStream;
> pc.ResourceTracker.AddResource( outputStream );
> // set the MessageType
> string MessageType = namespaceMessage + "#" + rootElementName;
>
> string systemPropertiesNamespace =
> "http://schemas.microsoft.com/BizTalk/2003/system-properties";
> inmsg.Context.Promote("MessageType", systemPropertiesNamespace,
> messageType);
>
>
> All works great if there is an orchestration for the MessageType =
> namespaceMessage + "#" + rootElementName
>
> What i dont understand is the folowing situation:
> when there is no orchestration subscribed to MessageType,BTS doesn't
> know how to dispatch the Message and correctly report an error.
>
> In this case if I look in the HAT and save the message I see the
> original message and not the new one wroten in
> the pipeline component.
> I can't understand why  the original message goes in the MessageBox
> and not the new one.
> Can someone explain me why this occurs?
> Thanks in advance, Al
>





[ Post a follow-up to this message ]



    Re: Custom component not always replacing the orginal message  
news.microsoft.com


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-30-05 11:00 PM

If there is no subscriber, even for the port, let alone the source or
destination meessage then there is no subscription. Thats why you can track
messages before and after pipeline.


"Al" <al_zxcvbnm@yahoo.co.uk> wrote in message
news:f896c1a6.0506280014.1fce99c3@posting.google.com...
> Hi all,
>
> I've implemented a decoder pipeline component which replace the
> original message with a new one.
> the code is:
>
> IBaseMessagePart bodyPart = inmsg.BodyPart;
>
> rootElementName = "Root";
> namespaceMessage = "http://name";
>
> MemoryStream  outputStream = new MemoryStream();
>
> XmlTextWriter xmlWriter    = new XmlTextWriter(outputStream,
> Encoding.UTF8);
> xmlWriter.WriteStartElement("ns0", rootElementName, namespaceMessage);
> xmlWriter.WriteStartElement("InputFileName");
> xmlWriter.WriteString("a string");
> xmlWriter.WriteEndElement();
> xmlWriter.WriteEndElement();
> xmlWriter.Flush();
>
> // rewind
> outputStream.Seek(0, SeekOrigin.Begin);
> // replace the original message
> bodyPart.Data = outputStream;
> pc.ResourceTracker.AddResource( outputStream );
> // set the MessageType
> string MessageType = namespaceMessage + "#" + rootElementName;
>
> string systemPropertiesNamespace =
> "http://schemas.microsoft.com/BizTalk/2003/system-properties";
> inmsg.Context.Promote("MessageType", systemPropertiesNamespace,
> messageType);
>
>
> All works great if there is an orchestration for the MessageType =
> namespaceMessage + "#" + rootElementName
>
> What i dont understand is the folowing situation:
> when there is no orchestration subscribed to MessageType,BTS doesn't
> know how to dispatch the Message and correctly report an error.
>
> In this case if I look in the HAT and save the message I see the
> original message and not the new one wroten in
> the pipeline component.
> I can't understand why  the original message goes in the MessageBox
> and not the new one.
> Can someone explain me why this occurs?
> Thanks in advance, Al







[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 06:17 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register