How do I include a non-XML attachment in the papiNet envelope?
The papiNet envelope contains an Attachment element that can be used to communicate any sort of information. Including an attachment that is XML content would use the same techniques as what is used to contain the papiNet business document in the BusinessDocument element. Including non-XML content requires the following approach: • Dim ns_pn as string = “http://www.papiNet.org/env” • Dim xtw as System.Xml.XmlTextWriter • Dim ms As System.IO.MemoryStream = New MemoryStream • Dim imageContent as string = System.Convert.ToBase64String(ms.GetBuffer) • xtw.WriteStartElement(“Attachment”, ns_pn) • xtw.WriteAttributeString(“AttachmentIdentifier”, ns_pn, “Filename.png”) • xtw.WriteString(imageContent) • xtw.WriteEndElement The above programming fragment (Microsoft Visual Basic referred to as VB) illustrates the basic concepts. Your particular situation and language will differ. • Defining a variable to hold the namespace for use in later steps. • In VB xml is created using an XmlTextWriter • T