BizTalk Server General - Disassemble Error

This is Interesting: Free IT Magazines  
Home > Archive > BizTalk Server General > December 2004 > Disassemble Error





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 Disassemble Error
How to catch disassemble error?

2004-11-30, 5:49 pm

Hi, I want to catch the error validation of a Flat File Disassembler. I've
inerithed the FFDasmComp but I can't catch anything. Why? My problem is that
I have to send an e-mail in case of error on disassembling explaining exactly
the error: do you have any idea?

thanks in advance


Fabio

David Downing [MSFT]

2004-11-30, 5:49 pm

You will need to catch the errors in the following circumstances:

Probe method
Disassemble method
GetNext method

In addition, you will need to create you own stream class and wrap the
stream with your stream. Your stream's read method should catch all the
exceptions thrown by calling the read method on the input stream.

Let us know if you have any questions or need further clarification.

Dave

--------------------[vbcol=seagreen]
catch disassemble error?@discussions.microsoft.com>[vbcol=seagreen]
cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGXA0
3.phx.gbl[vbcol=seagreen]
I've[vbcol=seagreen]
that[vbcol=seagreen]
exactly[vbcol=seagreen]

This posting is provided "AS IS" with no warranties, and confers no rights.

EBusiness Server Team

Fabio Brolese

2004-12-01, 7:46 am

Ok, I've tried to catch the error with no result in any of GetNext,
Disassemble or Probe method. I've tried with two files, they are equals but
the second one has an error. I noticed that sequence of method call is:
Probe, Disassemble and GetNext. This last one method is called twice for the
first file and one with the second. I think this appens because the error is
in the first part of the strem read. You said to implement my wrapper class,
what I've to do and HOW I've to use after created?

TIA

Fabio


""David Downing [MSFT]"" wrote:

> You will need to catch the errors in the following circumstances:
>
> Probe method
> Disassemble method
> GetNext method
>
> In addition, you will need to create you own stream class and wrap the
> stream with your stream. Your stream's read method should catch all the
> exceptions thrown by calling the read method on the input stream.
>
> Let us know if you have any questions or need further clarification.
>
> Dave
>
> --------------------
> catch disassemble error?@discussions.microsoft.com>
> cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGXA0
> 3.phx.gbl
> I've
> that
> exactly
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> EBusiness Server Team
>
>

David Downing [MSFT]

2004-12-01, 5:51 pm

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;
}



Dave

--------------------[vbcol=seagreen]
<FabioBrolese@discussions.microsoft.com>[vbcol=seagreen]
<8bZY#Dx1EHA.768@cpmsftngxa10.phx.gbl>[vbcol=seagreen]
cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGXA0
3.phx.gbl[vbcol=seagreen]
but[vbcol=seagreen]
the[vbcol=seagreen]
is[vbcol=seagreen]
class,[vbcol=seagreen]
the[vbcol=seagreen]
to[vbcol=seagreen]
cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGXA0[vbcol=seagreen]
is[vbcol=seagreen]
rights.[vbcol=seagreen]

This posting is provided "AS IS" with no warranties, and confers no rights.

EBusiness Server Team

Fabio Brolese

2004-12-02, 7:50 am

Great, this was a very good help that let me comprehend better what is done
during the disassembler, but it doesn't resolv the problem I have.
To exmplain better, what I'm trying to do is cacthing this error:
There was a failure executing the receive pipeline:
"FlussiDBUnico.Orchestrations.AcquisizioneFlussi.ReceivePipelineAcquisizioneFlussi"
Source: "Flat file disassembler" Receive Location:
"D:\fabio\BizTalkFilesInput\*.txt" Reason: Failed to validate the document:
"The 'Codice' element has an invalid value according to its data type. An
error occurred at , (1, 18756).".
this is what is written in the "Error Info" field. I now I can read on DB
the error but I want to read this information by code at run time, suddenly
after it happens.

Is my problem more clear?

TIA

Fabio




""David Downing [MSFT]"" wrote:

> 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;
> }
>
>
>
> Dave
>
> --------------------
> <FabioBrolese@discussions.microsoft.com>
> <8bZY#Dx1EHA.768@cpmsftngxa10.phx.gbl>
> cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGXA0
> 3.phx.gbl
> but
> the
> is
> class,
> the
> to
> cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGXA0
> is
> rights.
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> EBusiness Server Team
>
>

David Downing [MSFT]

2004-12-02, 5:48 pm

If you implement your custom FF disassembler as described below, you should
be catching these errors within your stream's read method. To access the
error message use the following on the catch statement:

catch (Microsoft.BizTalk.Message.Interop.BTSException ex)
{
string errorMessage = ex.GetArgument(0); // This returns the error
message you're seeking
// Whatever processing of the error you need to do...
}

--
Dave

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------[vbcol=seagreen]
<FabioBrolese@discussions.microsoft.com>[vbcol=seagreen]
<8bZY#Dx1EHA.768@cpmsftngxa10.phx.gbl>
<CEFC5924-0803-47F4-86B5-EF84282C0912@microsoft.com>
<EFZDDh#1EHA.3200@cpmsftngxa10.phx.gbl>[vbcol=seagreen]
done[vbcol=seagreen]
neFlussi"[vbcol=seagreen]
document:[vbcol=seagreen]
suddenly[vbcol=seagreen]
base[vbcol=seagreen]
cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGXA0[vbcol=seagreen]
equals[vbcol=seagreen]
is:[vbcol=seagreen]
for[vbcol=seagreen]
error[vbcol=seagreen]
the[vbcol=seagreen]
all[vbcol=seagreen]
<How[vbcol=seagreen]
cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGXA0[vbcol=seagreen]
Disassembler.[vbcol=seagreen]
problem[vbcol=seagreen]
explaining[vbcol=seagreen]
rights.[vbcol=seagreen]

Fabio Brolese

2004-12-03, 2:46 am

Yes, I've found it after a lot of try before looking your message. Thanks any
way.

catch (Exception ex)
{
for(int i = 0; i < ((BTSException)ex).ArgumentCount; i++)
PrintFileFunction( ((BTSException)ex).GetArgument(" + i +
"): " + ((BTSException)ex).GetArgument(i) );
}

This is my code, not fine but it helped me.

Your replys were extremely helpfull. Thank you very mach.



""David Downing [MSFT]"" wrote:

> If you implement your custom FF disassembler as described below, you should
> be catching these errors within your stream's read method. To access the
> error message use the following on the catch statement:
>
> catch (Microsoft.BizTalk.Message.Interop.BTSException ex)
> {
> string errorMessage = ex.GetArgument(0); // This returns the error
> message you're seeking
> // Whatever processing of the error you need to do...
> }
>
> --
> Dave
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
> --------------------
> <FabioBrolese@discussions.microsoft.com>
> <8bZY#Dx1EHA.768@cpmsftngxa10.phx.gbl>
> <CEFC5924-0803-47F4-86B5-EF84282C0912@microsoft.com>
> <EFZDDh#1EHA.3200@cpmsftngxa10.phx.gbl>
> done
> neFlussi"
> document:
> suddenly
> base
> cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGXA0
> equals
> is:
> for
> error
> the
> all
> <How
> cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGXA0
> Disassembler.
> problem
> explaining
> rights.
>
>

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com