1) Ah, that makes sense. SendFormDataArray is a method in EnsLib.HTTP.OutboundAdapter, but you're not using an adapter.

To do a POST using %Net.HTTPRequest, you'll need to use the Post() method.

2) I had a look at the HTTP specs, and it looks like content-disposition is required for each part:

In a multipart/form-data body, the HTTP Content-Disposition general header is a header that must be used on each subpart of a multipart body to give information about the field it applies to. The subpart is delimited by the boundary defined in the Content-Type header. Used on the body itself, Content-Disposition has no effect.

You can set this like any other header using the SetHeader method in %Net.MIMEPart. You're already doing that here:

Do BinaryMIMEPart.SetHeader("Content-Type", ContentType)

Quick example:

Class Demo.FunctionSet Extends Ens.Util.FunctionSet

ClassMethod SendRequestToHTTPOp(arg1 as %String, arg2 as %String) as %String {
    if '$D(%Ensemble("%Process")) {
        write "This doesn't work in DTL test mode",!
        quit "OOPS"
    } else {
        #dim bp as Ens.BusinessProcess

        set req = ##class(Ens.StringRequest).%New()
        set req.StringValue=arg1_"^"_arg2

        set bp=%Ensemble("%Process")
        set tSC=bp.SendRequestSync("My.HTTP.Operation",req,.resp)
        if $$$ISERR(tSC) {
            // Oops... error!


A visual trace URL takes the form of:


You'll need to run some queries (once in the router namespace and once in the edge namespace) to find the session ID that corresponds to your control ID.

You can find messages with that control id by querying the search table.

First you need to get the search table property ID for the MSHControlID. Change the value of ClassExtent to match whatever your local search table class is if you're not using the default:

SELECT PropId from Ens_Config.SearchTableProp WHERE ClassExtent='EnsLib.HL7.SearchTable' AND Name='MSHControlID'

Let's say that returns a PropId of 1

You can then query the search table for the control ID you're looking for where PropValue is the control id. If you have a custom search table you'll need to use your custom table name here instead of the default EnsLib_HL7.SearchTable:

SELECT DocId FROM EnsLib_HL7.SearchTable WHERE PropId=1 AND PropValue='123456789'

This gives you the ID for the message body. Let's say it returned a DocId of 98765. You can then query the message header table to get the session ID that that message body belongs to:

FROM Ens.MessageHeader WHERE MessageBodyID = 98765

Keep in mind that the URL for the Visual Trace could change in future versions, so you're doing this at your own risk.

Currently the most common approach for creating a web application/page which sources data from IRIS is to use one of the popular client side web application frameworks such as Angular, React, or vue.js. In IRIS you would build a web service which your app would call to get data.

Creating REST Services

The following sample works for me. HTML rendering capabilities are limited by what Apache FOP can handle.

Class test.ZenReportItemHtml Extends %ZEN.Report.reportPage

Parameter DEFAULTMODE = "pdf";

Parameter MYMARKUP = "<div style='font-weight:bold'>bold</div><br/><div>not-bold</div>";

XData ReportDefinition [ XMLNamespace = "http://www.intersystems.com/zen/report/definition" ]
<report xmlns="http://www.intersystems.com/zen/report/definition" name="Test" runonce="true">
     <element name="MyMarkup" escape="html" expression="..#MYMARKUP" />

XData ReportDisplay [ XMLNamespace = "http://www.intersystems.com/zen/report/display" ]
<report xmlns="http://www.intersystems.com/zen/report/display" name="Test">     
    <document width="8.5in" height="11in" marginLeft="1.25in"
      marginRight="1.25in" marginTop="1.0in" marginBottom="1.0in">
        <item field="MyMarkup" copyhtml="true" />