batched interchange (Composed Message Processor SDK Sample)

Home Page Forums BizTalk 2004 – BizTalk 2010 batched interchange (Composed Message Processor SDK Sample)

Viewing 0 reply threads
  • Author
    Posts
    • #21422

      Hi I wanted to to see if anyone has a possible solution to do what I need. The reason I would like to do this the way I’m asking is because of the likelihood of multiple occurances of a similar situation. The Orchestration takes the Flat File the PassThruRecieve and Applies the File to Variable declared in Orchestration as System.Xml.XmlDocument. I can pass this document to an external function as below

       

       

       

       

       

       

      public static XmlDocument AddCRLFToLastLine(XLANGMessage XMessage)

      {

      XmlDocument xDoc = new XmlDocument();

       

       

      XLANGMessage outputFile;

      xDoc = (System.Xml.

      XmlDocument)XMessage[0].RetrieveAs(typeof(System.Xml.XmlDocument));

       

       

       

      return xDoc;}

      This fails as the XlangMessage does not actually have any Xml markup despite BizTalk applying this to that type within the Orchestration.

      What  I Ideally need to do from within the Orchestration Take This File as The XlangMessage and use the string to perform some changes and then pass the result back to BizTalk and assign this to another System.Xml.XmlDocument.

       

       

       

       

       

      public

       

      static XmlDocument AddCRLFToLastLine(XLANGMessage XMessage)

      {

      string Message = string.Empty;

      StreamReader sr = new StreamReader((Stream)XMessage[0].RetrieveAs(typeof(Stream)));

      Message = sr.ReadToEnd();

       

      CommonFunctions cf = new CommonFunctions();

      Message = Message + cf.GetCarriageReturn();

       

       

      return Message;}

       

      So Within Biztalk a Message Declared MyGenericXmlMessage as System.Xml.XmlDocument another Message declared ConvertedMessage as type System.Xml.XmlDocument.

      In a Message Contsruct Shape and Message Assignment I would Ideally Need To

      ConvertedMessage =null;

      ConvertedMessage =MyExternalLibrary.AddCRLFToLastLine(MyGenericXmlMessage);

      And then Proceed to pass this to the ReceivePipeline.

      I’m assuming because BizTalk itself can take in the Flat File and Not Actually change any of it;s structure yet assign this to a Message of System.Xml.XmlDocument type with no XML markup applied there may be a way of using some of BizTalks features to do this within my function (I’m hoping)

      Any help on this would greatly appreciated

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