How to get DateTime from PI message SOAP Header
Can you please let me know how we can get the time message received in PI from the SOAP message header
I would like to capture this value and send it in the payload of the message, initially I was using the Current TIme date function.
However, if I can get the time received value from the SOAP Header message, It will be more accurate in providing the Time the message was received by IE.
Sample SOAP Header from MONI:-
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> - <!-- Call Adapter --> - <SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SAP="http://sap.com/xi/XI/Message/30"> - <SOAP:Header> - <SAP:Main xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" versionMajor="003" versionMinor="000" SOAP:mustUnderstand="1" wsu:Id="wsuid-main-92ABE13F5C59AB7FE10000000A1551F7"> <SAP:MessageClass>ApplicationMessage</SAP:MessageClass> <SAP:ProcessingMode>asynchronous</SAP:ProcessingMode> <SAP:MessageId>4C69D4B7-9806-0162-E100-80000A8221E6</SAP:MessageId> <SAP:TimeSent>2010-08-17T16:24:16Z</SAP:TimeSent> - <SAP:Sender>
Samiullah Qureshi replied
If you want to get the TimeSent from SOAP header and map it to some field in ur message then u can easily do it using following UDF :-
GlobalContainer globalContainer;globalContainer = container.getGlobalContainer(); java.util.Map param = globalContainer.getParameters();. String timeSent = (String) param.get (StreamTransformationConstants.TIME_SENT); return timeSent ;
Note: This UDF won't need any input. So u need not to maintain any variable in UDF signature.
Edited by: Samiullah Qureshi on Aug 18, 2010 9:41 AM