Cannot access a closed stream – biztalk 2004 to 2006 migration with submit direct adapter

Home Page Forums BizTalk 2004 – BizTalk 2010 Cannot access a closed stream – biztalk 2004 to 2006 migration with submit direct adapter

Viewing 1 reply thread
  • Author
    Posts
    • #16552

      hi all,

      we are currently, migrating a biztalk server 2004 to 2006. we are using the submitdirect adapter, and we are currently encountering problems in one of our services. we are getting a "Cannot access a closed stream" error message after the orchestration has finished processing. This is the code we use to send and receive the message:

       // Create BizTalk message submission object
      01 BizTalkMessaging btm = new BizTalkMessaging();
      02      StreamReader sr = null;

       // Submit message and wait for response
       // The charset information is empty because it will be determined by XML disassembler from BOM of file
      03 IBaseMessage responseMsg = btm.SubmitSyncMessage(btm.CreateMessageFromStream(submitURI, null, fileStream));

       // Get an XML from response and print it out in console window
      04 if (null != responseMsg)
      05 {
      06  if ((responseMsg.BodyPart!=null) && (responseMsg.BodyPart.Data!=null))
      07  {
      08   StreamReader sr = new StreamReader(responseMsg.BodyPart.Data);
      09   Console.WriteLine("Response message:");
      10   Console.WriteLine(sr.ReadToEnd());
      11  }
      12 }

      on line 10, we get the "Cannot access a closed stream error" but this does not happen on a regular basis.

      we also get this error in the eventlog:

      Event Type: Error
      Event Source: .NET Runtime
      Event Category: None
      Event ID: 0
      Date:  11/28/2006
      Time:  6:13:16 PM
      User:  N/A
      Computer: MND06070656
      Description:
      The description for Event ID ( 0 ) in Source ( .NET Runtime ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description; see Help and Support for details. The following information is part of the event: Unable to open shim database version registry key – v2.0.50727.00000.

      would it be possbile, that this error is related to the error on the first example?

      your help, would truly be appreciated.

    • #16609

      The BizTalking Cat talks about the error here: http://biztalkblogs.com/fairycat/archive/2006/09/11/1505.aspx

       

      Although I’m not thinking that’s the problem.  Are you sure the Orchestration is returning a message?  It almost sounds like it is not returning data or not return data in a timely manner.

Viewing 1 reply thread
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.