Tomohiro Iwamoto · Jun 18, 2020 go to post

Hi Tim,

Assuming you are extending EnsLib.MsgRouter.RoutingEngine, does this work for you?

Mentioned briefly here.

Class User.MyRouter Extends EnsLib.MsgRouter.RoutingEngine
{
Method OnPrepareReply(request As %Persistent, ByRef response As %Persistent)
{
  Set response=##class(Ens.StringContainer).%New()
  Set cnt=$this.%ResponseList.Count()
  For i=1:1:cnt {
    Set messageHeaderId=$this.%ResponseList.GetAt(i)
    Set messageHeader=##class(Ens.MessageHeader).%OpenId(messageHeaderId)
    Set messageBody=$CLASSMETHOD(messageHeader.MessageBodyClassName,"%OpenId",messageHeader.MessageBodyId)
    Set response.StringValue=messageBody.StringValue_"|"_response.StringValue
  }
}
}

viewer

Tomohiro Iwamoto · Oct 6, 2020 go to post

Hi,

I’ve posted the article and git repo while ago probably exactly what you are looking for.

Only if you can handle Japanese and docker....
 

Tomohiro Iwamoto · Aug 10, 2022 go to post

I've made such an adapters based on Jose's work.

My articles, I'm afraid which is written in Japanese only,  is using IMAP/SMTP against gmail as target provider but I hope it works against Office365 as well.

The idea is you prepare a JSON file like this and production will pick it up when it starts (via OnStart() callback).
After that, adapter itself get new AccessToken periodically by using a given RefreshToken (well, at least that what I've intended).