Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How do I include a non-XML attachment in the papiNet envelope?

envelope non-xml papinet
0
Posted

How do I include a non-XML attachment in the papiNet envelope?

0

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

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.