|
Home > Archive > BizTalk Server General > February 2005 > Pipeline Validate Document Structure=true
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 |
Pipeline Validate Document Structure=true
|
|
|
| I want to trap invalid documents received for custom error logging.
What type of custom component should I have and which method should I
override ?
| |
| Ruslan Yakushev [MSFT] 2005-02-25, 5:49 pm |
| Override IComponent.Execute method of XML Validator.
>
>I want to trap invalid documents received for custom error logging.
>What type of custom component should I have and which method should I
>override ?
>
>
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
Note: For the benefit of the community-at-large, all responses to this
message are best directed to the newsgroup/thread from which they
originated.
| |
|
|
Would this apply to badly formed flat files as well ? Does the error
occur in the XML Validator in this case or a stage before the
validation ?
| |
|
| I had to write my own stream class such and reference it in the
GetNext() method:
"You'll need to write your own Stream class that does something like
the following:
class MyStream : Stream
{
private Stream inputStream = null;
public MyStream(Stream stm)
{
inputStream = stm;
}
... Other Stream Methods ...
int Read(byte[] buffer, int offset, int length)
{
int bytesRead = 0;
try
{
// Read from the input stream into the buffer
bytesRead = inputStream.Read(buffer, offset, length);
}
catch
{
// This is where you need to handle the exceptions
}
return bytesRead;
}
}
When you Disassembler gets called during GetNext(...), set the message
stream to your stream that is constructed using the message from the
base GetNext call.
public new void GetNext(IPipelineContext pc)
{
IBaseMessage msg = null;
try
{
msg = base.GetNext(pc);
msg.BodyPart.Data = new MyStream(msg.BodyPart.Data);
}
catch
{
// This is where you need to handle the exceptions
}
return msg;
}
It was detailed in this post:
http://groups-beta.google.com/group...%26&_doneTitle=
Back+to+Search&&d#366f2aff501c87b6
|
|
|
|
|