Written by

Question Gaolai Peng · Nov 8, 2018

How to get a SDA3.Container object from a Stream object

I am trying to get SDA3.Container object from a Stream object like following code:

Method HandleECRUpdateRequest(pRequest As CUSTOM.CORE.Message.ECRUpdateRequest, ByRef pResponse As Ens.Response) As %Status
{

               Set tContainer=##Class(HS.SDA3.Container).%New()
               $$$ThrowOnError(tContainer.InitializeXMLParse(pRequest.ContentStream, "SDA3"))
              
               Set tEventDescription=tContainer.EventDescription

But it tContainer seems to be empty. The tEventDescription is set to empty. I need work on the whole HS.SDA3.Container converted from ContentStream in a ECRUpdateRequest. Doesn't anyone know how to achieve this?

Thanks,

Comments

Saul Bloom · Nov 26, 2018

We try to not operate on an entire container, since containers can be arbitrarily large.  The API that you are using is one that should be combined with GetNextSDA, to process one streamlet at a time.

0
Rob Schoenmakers · May 10, 2023

Gaolai,  I'm having the same problem here.. Can you tell me if and how you fixed this?

0
Eduard Lebedyuk  May 10, 2023 to Rob Schoenmakers
set sda3 = ##class(HS.SDA3.Container).%New()
do sda3.InitializeXMLParse(.stream)
while sda3.GetNextSDA(.type, .obj) {
	// process?
}
0