BizTalk Server Orchestration - XML Disassembler Component, Urgent

This is Interesting: Free IT Magazines  
Home > Archive > BizTalk Server Orchestration > May 2004 > XML Disassembler Component, Urgent





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author XML Disassembler Component, Urgent
Carloni

2004-05-04, 12:19 pm

Hi there,

I implemented all the component interfaces, and my new pipeline
component shows up in the toolbox. All it does is change a XML node value from the received message.

Here's the code from my component's Disassemble method, which I have confirmed is running when I drop in a XML file if I let those lines comment. If I Uncomment those lines I'll get the following error:

<< The "FILE" adapter is suspending a message coming from Source URL:"c:\TrackTrace\FileDrop\*.xml". Details:"Error in accessing the part data or one of its fragments. The part or fragment may not exist in the database. " >>

Any ideas why Biztalk acts like that ?


CODE:

...

private bool _allMsgSent = false;
private bool _firstTime = true;
private XmlDocument inboundXml = new XmlDocument();
private Stream inboundStream;
private IBaseMessagePart bodyPart;
private IBaseMessage bMsg;


public new IBaseMessage GetNext(IPipelineContext pContext)
{
if (!_allMsgSent)
{
if (_firstTime)
{
bMsg = base.GetNext(pContext);
// bodyPart = bMsg.BodyPart;
// if (bodyPart != null)
// {
// inboundStream = bodyPart.GetOriginalDataStream();
// if (inboundStream != null)
// {
// inboundXml.Load(inboundStream);
// bodyPart.Data = inboundStream;
// }
// }
_firstTime = false;
}

return bMsg;
}

return null;
}
Matt Milner

2004-05-04, 9:35 pm

Most likely because when you load the xml dom you are reading the stream to
the end so when the message gets to the next stage, there is no data in the
stream. try marking the position of the stream before loading it into the
dom, then reset it after loading.

Also keep in mind that by using the dom, you are limiting your scalability.
Pipeline components really need to use streaming xml interfaces to remain
scalable to large message types.

Matt


"Carloni" <Carloni.15qsiw@mail.webservertalk.com> wrote in message
news:Carloni.15qsiw@mail.webservertalk.com...
>
> Hi there,
>
> I implemented all the component interfaces, and my new pipeline
> component shows up in the toolbox. All it does is change a XML node
> value from the received message.
>
> Here's the code from my component's Disassemble method, which I have
> confirmed is running when I drop in a XML file if I let those lines
> comment. If I Uncomment those lines I'll get the following error:
>
> << The "FILE" adapter is suspending a message coming from Source
> URL:"c:\TrackTrace\FileDrop\*.xml". Details:"Error in accessing the
> part data or one of its fragments. The part or fragment may not exist
> in the database. " >>
>
> Any ideas why Biztalk acts like that ?
>
>
> CODE:
>
> ..
>
> private bool _allMsgSent = false;
> private bool _firstTime = true;
> private XmlDocument inboundXml = new XmlDocument();
> private Stream inboundStream;
> private IBaseMessagePart bodyPart;
> private IBaseMessage bMsg;
>
>
> public new IBaseMessage GetNext(IPipelineContext pContext)
> {
> if (!_allMsgSent)
> {
> if (_firstTime)
> {
> bMsg = base.GetNext(pContext);
> // bodyPart = bMsg.BodyPart;
> // if (bodyPart != null)
> // {
> // inboundStream = bodyPart.GetOriginalDataStream();
> // if (inboundStream != null)
> // {
> // inboundXml.Load(inboundStream);
> // bodyPart.Data = inboundStream;
> // }
> // }
> _firstTime = false;
> }
>
> return bMsg;
> }
>
> return null;
> }
>
>
>
> --
> Carloni
> ------------------------------------------------------------------------
> Posted via http://www.webservertalk.com
> ------------------------------------------------------------------------
> View this thread: http://www.webservertalk.com/message211644.html
>



hsmehta21

2004-05-19, 3:00 am

Hi Matt,

I am also facing the same problem, it can sound pretty dull.

How can we mark the stream and then reset to original, since i tried using seek and positional both, but canseek is FALSE for the streamREader, please put some light on this.

Do i need to use some other stream wrapper?

TIA.
Hemal
quote:
Originally posted by Matt Milner
Most likely because when you load the xml dom you are reading the stream to
the end so when the message gets to the next stage, there is no data in the
stream. try marking the position of the stream before loading it into the
dom, then reset it after loading.

Also keep in mind that by using the dom, you are limiting your scalability.
Pipeline components really need to use streaming xml interfaces to remain
scalable to large message types.

Matt


"Carloni" <Carloni.15qsiw@mail.webservertalk.com> wrote in message
news:Carloni.15qsiw@mail.webservertalk.com...
>
> Hi there,
>
> I implemented all the component interfaces, and my new pipeline
> component shows up in the toolbox. All it does is change a XML node
> value from the received message.
>
> Here's the code from my component's Disassemble method, which I have
> confirmed is running when I drop in a XML file if I let those lines
> comment. If I Uncomment those lines I'll get the following error:
>
> << The "FILE" adapter is suspending a message coming from Source
> URL:"c:\TrackTrace\FileDrop\*.xml". Details:"Error in accessing the
> part data or one of its fragments. The part or fragment may not exist
> in the database. " >>
>
> Any ideas why Biztalk acts like that ?
>
>
> CODE:
>
> ..
>
> private bool _allMsgSent = false;
> private bool _firstTime = true;
> private XmlDocument inboundXml = new XmlDocument();
> private Stream inboundStream;
> private IBaseMessagePart bodyPart;
> private IBaseMessage bMsg;
>
>
> public new IBaseMessage GetNext(IPipelineContext pContext)
> {
> if (!_allMsgSent)
> {
> if (_firstTime)
> {
> bMsg = base.GetNext(pContext);
> // bodyPart = bMsg.BodyPart;
> // if (bodyPart != null)
> // {
> // inboundStream = bodyPart.GetOriginalDataStream();
> // if (inboundStream != null)
> // {
> // inboundXml.Load(inboundStream);
> // bodyPart.Data = inboundStream;
> // }
> // }
> _firstTime = false;
> }
>
> return bMsg;
> }
>
> return null;
> }
>
>
>
> --
> Carloni
> ------------------------------------------------------------------------
> Posted via http://www.webservertalk.com
> ------------------------------------------------------------------------
> View this thread: http://www.webservertalk.com/message211644.html
>

Matt Milner

2004-05-19, 8:40 pm

Yes, take a look at the following sample for an example of a seekable
readonly stream:

SDK\Samples\Pipelines\ArbitraryXPathProp
ertyHandler

This is a fancy stream wrapper that even does buffering to allow you to seek
on a stream that does not allow it.

Matt


"hsmehta21" <hsmehta21.16i13r@mail.webservertalk.com> wrote in message
news:hsmehta21.16i13r@mail.webservertalk.com...
>
> Hi Matt,
>
> I am also facing the same problem, it can sound pretty dull.
>
> How can we mark the stream and then reset to original, since i tried
> using seek and positional both, but canseek is FALSE for the
> streamREader, please put some light on this.
>
> Do i need to use some other stream wrapper?
>
> TIA.
> Hemal
> Matt Milner wrote:
>
>
>
> --
> hsmehta21
> ------------------------------------------------------------------------
> Posted via http://www.webservertalk.com
> ------------------------------------------------------------------------
> View this thread: http://www.webservertalk.com/message211644.html
>



Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com