Skip to Content

There were many questions on PI forum asking about how to get the content of PI message from the PI tables. It seems that as far as it’s relatively easy to do it if the message is stored in abap tables it’s a little bit more difficult if you’re using local AAE (without IE) and the message it not stored in the ABAP tables. Is there any nice way you can retrieve the message from local AAE then?

It turns out there is and it’s not that difficult – let me show you the steps:

1. In order to get the message we will have to do two steps – call two web services and decode the message. I’m not going to show you how to call Web Serivces in ABAP as this was already described many times like in this blog:

BSP a Developer’s Journal Part XIV – Consuming WebServices with ABAP

2. At first we need to find Web Serice called – AdapterMessageMonitoringVi in WSNAVIGATOR

3. Then we need to call one of it’s methods – getMessageList in order to get messageKey of the PI message. The only input parameter is “messageIDs” and you will get messageKey as the output parameter as shown in the screen below.

4. The next step is to call the same Web Service – this time with method – getMessageBytesJavaLangStringBoolean to get the message content. The only input parameter is the messageKey.

and if the messagekey exists you should get an output similar to the one shown below.

5. As you can see the value of the response tag does not resemble the PI message yet but we’re not done yet. The content of the message is encoded with base64 so now that you have the encoded PI message you just need to decode it and you can do it in ABAP as shown in this WIKI:

Decoding BASE64 in ABAP

If you don’t belive me and want to check the message content before writing the ABAP code have a look at this free web based base64 decoder

http://www.opinionatedgeek.com/dotnet/tools/Base64Decode/Default.aspx

 

So now you know how you can get the PI message easily from the java stack of PI 🙂

To report this post you need to login first.

3 Comments

You must be Logged on to comment or reply to a post.

  1. Vijayashankar Konam
    Hi Michal,
    This blog came in right at the moment I was searching for the service “AdapterMessageMonitoringVi” availability in PI 7.1. I was able to find this in PI 7.0 in WSNavigator from PI Java homepage. But I was not able to find this in PI 7.1. The screenshots you pasted seem to be from 7.1.1. Could you help me finding this service in PI 7.1?

    Regards,
    VJ

    (0) 
  2. Vicky G

    Hi Michael,

    As I understand this is to get the payload from BC_MSG. Can this also be used to read the status of the message. I have a requirment to read the message status and if it is delivering status for more than 30 misn than send out an email.

    Vicky.

    (0) 
  3. Michal Basl

    Hello,  do you know if is there also a way how to get specified message from java function if I  know Message ID? And check the satus of this message? Thx

    (0) 

Leave a Reply