Constructing empty messages

Home Page Forums BizTalk 2004 – BizTalk 2010 Constructing empty messages

Viewing 1 reply thread
  • Author
    Posts
    • #12881

      How ca I construct an empty mesage without using the transform object?

    • #12882

      The simplest way is to:

      Create an System.Xml.XmlDocument orchestration variable, load an Xml string and assign this to a message in a message assignment shape.

      [code:1:d8064e0e86]xmlDoc.LoadXml(\"<message><node/></message>\");
      message = xmlDoc;[/code:1:d8064e0e86]

      This can get difficult if the Xml is large. In which case you could create a .Net assembly with a static method which returns System.Xml.XmlDocument

      [code:1:d8064e0e86]namespace MyAssembly
      class Helper{
      public static System.Xml.XmlDocument CreateMessage()
      {
      //code create XmlDocument here
      }
      }[/code:1:d8064e0e86]

      Compile and GAC this assembly and call from a message assignment shape

      [code:1:d8064e0e86]message = MyAssembly.Helper.CreateMessage();[/code:1:d8064e0e86]

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