Creating a Custom Message Handling
Posted: Wed Mar 13, 2024 5:27 am
Following on from a post I created yesterday, it seems like the AGENT_INCLUDE.txt doesn't let you add the HTTP header because you can't get access to the currentMessageContext.
The following documentation indicates you can create a custom message handler.
https://docs.lansa.com/14/en/lansa093/i ... %7C_____17
My thought is that I can do this and add the following code to it. I can't add this code to AGENT_INCLUDE.TXT because getCurrentContext returns null.
org.apache.axis.MessageContext msgContext = org.apache.axis.MessageContext.getCurrentContext();
if (msgContext != null)
{
java.util.Hashtable userHeaderTable = (java.util.Hashtable) msgContext.getProperty(org.apache.axis.transport.http.HTTPConstants.REQUEST_HEADERS);
}
userHeaderTable.put("Authorization", "Bearer MYBEARERTOKEN");
Has anyone implemented custom message handling for SOAP? If so, would you care to share some tips.
The following documentation indicates you can create a custom message handler.
https://docs.lansa.com/14/en/lansa093/i ... %7C_____17
My thought is that I can do this and add the following code to it. I can't add this code to AGENT_INCLUDE.TXT because getCurrentContext returns null.
org.apache.axis.MessageContext msgContext = org.apache.axis.MessageContext.getCurrentContext();
if (msgContext != null)
{
java.util.Hashtable userHeaderTable = (java.util.Hashtable) msgContext.getProperty(org.apache.axis.transport.http.HTTPConstants.REQUEST_HEADERS);
}
userHeaderTable.put("Authorization", "Bearer MYBEARERTOKEN");
Has anyone implemented custom message handling for SOAP? If so, would you care to share some tips.