XLANGPart.LoadFrom(stream) failing - UnauthorizedAccessException
- From: "Sergiy" <bryn@xxxxxxxxxxxxxxxxxx>
- Date: Tue, 8 Aug 2006 12:19:05 +1000
Hi,
I am trying to update an XLANGMessage in my custom component. I have an
orchestration that receives message A.
In a construct shape (declared as constructing message B), message A is then
assigned to message B, and message B is passed from a message assignment
shape into my component as a parameter to a method.
My component then generates a PDF stream using Crystal Reports, and then
attempts to load the XLANGMessage's 1st data part with the stream generated
by Crystal. This is causing an error (details at bottom of post).
The error indicates that the GetBuffer method is causing the error. I have
tried wrapping the memory stream in a BufferedStream, but this causes
another exception altogether indicating the Load method is expecting a
MemoryStream to load from.
Does anyone have any ideas what I am doing wrong? Is there any other way to
load the stream into the part's data?
Details of code are:
// Create a crystal report object
ReportDocument report = new ReportDocument();
/// Load report here and bind to data...
// Export report to stream. Actual stream generated by Crystal is a
MemoryStream
Stream reportStream =
report.ExportToStream(ExportFormatType.PortableDocFormat);
// Stream now has data.
// Load data into XLANGMessage part. THIS CAUSES EXCEPTION...
dataMessage[0].LoadFrom(reportStream);
ERROR DETAILS:
====================
Exception thrown from: segment 1, progress 8
Inner exception: MemoryStream's internal buffer cannot be accessed.
Exception type: UnauthorizedAccessException
Source: mscorlib
Target Site: Byte[] GetBuffer()
The following is a stack trace that identifies the location where the
exception occured
at System.IO.MemoryStream.GetBuffer()
at Microsoft.XLANGs.Core.Value..ctor(Stream s)
at Microsoft.XLANGs.Core.Part.GenericLoadFrom(Object source)
at Microsoft.XLANGs.Core.XSDPart.ProtectedLoadFrom(Object source)
at Microsoft.XLANGs.Core.Part.LoadFrom(Object source)
at Microsoft.XLANGs.Core.PartWrapperForUserCode.LoadFrom(Object source)
at
Bryn.BabelTower.BizTalk.Core.Components.ReportGenerator.GenerateReport(XLANGMessage
dataMessage, String reportPath)
at
Bryn.BabelTower.BizTalk.Core.Orchestrations.ReportGenerator.segment1(StopConditions
stopOn)
at Microsoft.XLANGs.Core.SegmentScheduler.RunASegment(Segment s,
StopConditions stopCond, Exception& exp)
.
- Follow-Ups:
- Re: XLANGPart.LoadFrom(stream) failing - UnauthorizedAccessException
- From: Scott Colestock
- Re: XLANGPart.LoadFrom(stream) failing - UnauthorizedAccessException
- Prev by Date: Re: BAS TPPubWS question
- Next by Date: Allow cache on write
- Previous by thread: RE: Detected SQL Adapter shutdown
- Next by thread: Re: XLANGPart.LoadFrom(stream) failing - UnauthorizedAccessException
- Index(es):
Relevant Pages
|
|