Create a table with below properties

Class MessageStore Extends %Persistent
{

Property ReceivedTime as %TimeStamp;

Property MessageContent as %GlobalBinaryStream;

}

Now in your WebMethod create one object of a stream object.

Method GetHL7Message(Payload As %GlobalBinaryStream) As %Status[ WebMethod ]
{
  set oStreamContent=##class( %GlobalBinaryStream).%New()
  set tSC=oStreamContent.CopyFrom(Payload)
  set oTable=##class(MessageStore).%New()
  set oTable.MessageContent .CopyFrom(oStreamContent) /// Sometime directly copying does not work not sure why. Try this when exactly it can copy
  set oTable.ReceivedTime=##class(%Library.UTC).NowLocal()
  set tSC=oTable.%Save()
}

Now in your zen page show the content in a text area. using textArea.value=OStream.Read()

Let me know if you face any more problem with this.

The best way would be to transfer the cache.dat of all the namespaces. That would transfer all data , including the code.

Transfer from Com1 to Com2.

Steps :

1. Create same number namespaces in Com2

2. Unmount all databases , in Com1 and Com2

3. Copy all corrosponding Cache.dat to Com2.

4. Mount all databases in Com2.

You are ready to go. Open studio and verify the codes if they are present.

When we are extedning EnsLib.REST.Service, if we set the response code in stream attribute it would send the reponse in that way.

XData UrlMap [ XMLNamespace = "http://www.intersystems.com/urlmap]
{
<Routes>
<Route Url="/test" Method="POST" Call="MyLib.Service.REST.TestRequestHandler:ProcessRequest"/>
</Routes>
}

-----------------

And the class contains

Class OCIELib.Service.REST.TestRequestHandler Extends %RegisteredObject
{

ClassMethod ProcessRequest(pStreamIn As %CharacterStream, Output pStreamOut As %Stream.Object) As %Status
{
// This method returns a test resonse that can be used to verify connectivity between client
// and OCIE REST endpoint.
Do pStreamOut.SetAttribute("Content-Type","application/text")
Do pStreamOut.Write("THIS IS A TEST RESPONSE FROM THE SYSTEM")
do pStreamOut.SetAttribute("ResponseCode","400 Bad Request")
Quit $$$OK
}

Hope this helps. I was also stuck here , found the solution today itself.