cancel
Showing results for 
Search instead for 
Did you mean: 

How to get DateTime from PI message SOAP Header

Former Member
0 Kudos

Hi ALL

Can you please let me know how we can get the time message received in PI from the SOAP message header

<SAP:TimeSent>2010-08-17T16:24:16Z</SAP:TimeSent>

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.

Thank you,

Parikshit

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>

Accepted Solutions (1)

Accepted Solutions (1)

samiullah_qureshi
Active Contributor
0 Kudos

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

Answers (1)

Answers (1)

former_member204873
Contributor
0 Kudos

hi,

You can use StreamTransformationConstants for fetching few fileds such as Interface name, Time etc.

http://help.sap.com/javadocs/NW04/current/pi/constant-values.html#com.sap.aii.mapping.api.StreamTran...

Thanks.

Former Member
0 Kudos

Thanks! Mayank, Samiullah

Regards,

Parikshit