Reading large stream from %CSP.Request
We have created a number of REST adapters that extend %CSP.REST and these have been working fine. However, we are now facing a problem with a new one where very large XML documents are being posted. This is the pattern we are following:
Set tSC = ##class(Ens.Director).CreateBusinessService("Epro_ItkHttp",.tBusinessService)
Set tSC = tBusinessService.ProcessInput(inMsg, .tBusinessServiceOutput)
However, when the %request is particularly long, it is being truncated, and working with %XML.Reader then fails in the business service class.
I believe the call to Read() is the problem. If I call it with some arbitrarily long value - such as Read(500000) - then it works.
What is the correct approach here? Is there any harm in putting in a massive number into the len parameter of the Read() method? Or is there a way of looping through the stream and constructing the object to pass to the business service?
Any advice much appreciated.