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).

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.

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.

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.

If your Operation config. is exactly as described above then I think that's your problem - the settings to get back specifically that one document should (I think) be:

HTTP Server : jsonplaceholder.typicode.com

HTTP Port : 443

URL : /posts/42

(Assuming you've got a SSL config. set up in the Operation btw, because that URL is https).

If that doesn't work let me know and I'll try knocking up my own code to do it.