Sorry, formatting messed up and I can't seem to edit... If your message class is the one you want to convert just extend both XML and JSON ? Extends (%Persistent, %XML.Adaptor, %JSON.Adaptor) And (assuming your schemas line up): Set tSC = tMsg.%JSONExportToString(.tJSONMsg)
If your message class is the one you want to convert just extend both XML and JSON ? Extends (%Persistent, %XML.Adaptor, %JSON.Adaptor) And (assuming your schemas line up): Set tSC = tMsg.%JSONExportToString(.tJSONMsg)
Certifications & Credly badges:
Neil has no Certifications & Credly badges yet.
Global Masters badges:
![Open Sesame!](https://community.intersystems.com/sites/default/files/badges/303371180-6de11138-f4e7-4113-b5cc-836269f07693.png)
![Challenge Starter](https://community.intersystems.com/sites/default/files/badges/295959213-b83dd91a-663f-4f07-8e0e-e3287b7c2309.png)
![DC Commenter](https://community.intersystems.com/sites/default/files/badges/dc_commenter_1.png)
Followers:
Neil has no followers yet.
Following:
Neil has not followed anybody yet.
At this point in your code - Do base64.Rewind() - base64 isn't a stream object because of how you've populated it earlier in the DTL.
I'm guessing
target.{PIDgrpgrp(1).ORCgrp(1).OBXgrp(1).OBX:5(1).5} returns a string so you need to write that into the Stream:
base64.Write({PIDgrpgrp(1).ORCgrp(1).OBXgrp(1).OBX:5(1).5})
before you call your custom function (assuming you've already instantiated your stream).