go to post Neil Sheed · Nov 29, 2021 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).
go to post Neil Sheed · Nov 24, 2021 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)
go to post Neil Sheed · Oct 22, 2019 Haven't tried this directly yet so this is more of a suggestion for discussion - subclass EnsLib.File.InboundAdapter and override getArchiveFilename: Method getArchiveFilename(pWorkFilename As %String) As %String [ Internal ]{ Set tDateStamp = $ZD($Horolog, 3) Set tArchivePath = ##class(%File).NormalizeDirectory(tDateStamp, ..ArchivePath) If ('##class(%File).DirectoryExists(tArchivePath)) { Do ##class(%File).CreateDirectoryChain(tArchivePath, .tRet) } Quit ..CreateTimestamp(##class(%File).GetFilename(pWorkFilename),$S(""'=..WorkPath&&(..WorkPath'=..FilePath):"%f",1:$Case(..AppendTimestamp,"":"%f",0:"%f",1:"%f_%Q%!+(_a)",:..AppendTimestamp)),,tArchivePath)} Probably a lot wrong with that but it's a starting point.
go to post Neil Sheed · Feb 21, 2019 Hi, just had a look at our code for a similar use and we're doing almost exactly the same: Do pHTTPRequest.SetHeader("Authorization", "Bearer " _ tOAuthToken)and that's working fine so I'm not sure why yours is failing (apart from OAuth2 interfaces seem to be very picky).Btw I'm not sure why but your Postman example headers seem to have picked up a lot of spurious double quotes.
go to post Neil Sheed · Sep 3, 2018 Ok - good news/bad news sort of thing.I can get you a bit further - I tried a quick test locally and it looks like you do need an SSL config. but in my instance there's some issue with negotiating the SSL connection that's causing it to fail.Anyway - SSL configuration - from the homepage of your Management Portal go to System Administration -> Security -> SSL/TLS Configurations and click on "Create New Configuration". Give it the Configuration Name "typicode" and Save it.Back in your Ensemble production select your Business Operation and in the configuration look for the "Connection Settings" section - there should be a dropdown for "SSL Configuration" and if everything's worked above then "typicode" should be a selectable value. Select that and Apply the config. and then try again.If you get "ERROR #6085: Unable to write to socket with SSL/TLS configuration 'typicode', error reported 'SSL/TLS error in SSL_connect(), SSL_ERROR_SSL: protocol error, error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure'" then you're at the same point as me.