Michal’s PI tips: How to get RWB message overview data to an external system?
As you probably know there are no web services for displaying RWB message overview data and this has been an issue for some companies which wanted to use their own tools to check aggragated message status. SAP has come up with a different way to handle this requirement – they have come up with a servlet which allows to retrieve the RWB monitoring data with an HTTP call.
When can we use this new servlet ?
You can use this servlet anytime you need to send the RWB message overview data to an external system or if the external system can query the servlet itself. You can use PI’s HTTP adapter to get the data from the servlet and share it as anything that PI supports (XML file, SOAP calls, e-mails, etc.)
How to use this servlet ?
Step 1
First you need to get the XSD which describes the XML result of querying the servlet. You can get it with address:
http://<host>:<port>/mdt/monitor/MessageOverviewQuery.xsd
Step 2
You need to check which components you can query. You can do this by checking address:
http://<host>:<port>/mdt/messageoverviewqueryservlet
At the bottom of this service you should be able to see the components you can use in the HTTP post.
So now your query would look like: http://server:port/mdt/messageoverviewqueryservlet?component=<XIComponentName>
Step 3
The third thing you need to add to your query would be the view. There are 4 types of views you can use:
a) R_ENTRY_VIEW_XPI – Message status sorted by receiver
b) S_ENTRY_VIEW_XPI – Message status sorted by receiver
c) SR_ENTRY_VIEW_XP – Message status sorted by sender and receiver (detail view)
d) SR_ENTRY_OVERVIEW_XPI – Message status sorted by sender and receiver (overview)
Now your query would be: http://server:port/mdt/messageoverviewqueryservlet?component=<XIComponentName>&view=<ViewNameKey>
Step 4
The last thing you need to add to your query would be the start and end date of the query. If you start your HTTP post with this address: http://server:port/mdt/messageoverviewqueryservlet?component=<XIComponentName>&view=<ViewNameKey> you will see sample start and end dates in the format respected by the servlet.
Now your full query should look like this:
http://server:port/mdt/messageoverviewqueryservlet?component=<XIComponentName>&view=<ViewNameKey>&begin=<IntervalBeginTime>&end=<IntervalEndTime>
Result
Sample result from my test system would can be like shown below.
What are the prerequisites:
For the prerequisites please have a look:
Note 1400785 – Message Overview: automatic query of data with a servlet
Hi Michal,
Excelent blog and wonderful new for me. isn't there any problem to combine it with the alert configuration?
Regards.
Hi,
you can do anything you need with this info - my client (a year ago) wanted to know the percentange of successfull messages to not successfull so we've pushed it to BW but you can get the data with HTTP and start a function module for alerts easily,
Regards,
Michal Krawczyk
Hi Michael,
as usual, excellent blog and very helpful information!
I wonder if there is another API or Servlet that allows the retrieval of RWB performance data.
Are you aware of something like this?
Thanks,
Klaus
Hi Michael,
thanks for this post!
Can you please provide some examples for the timeperiod. I'm a little bit confused, which format should be used. I'm always receiving a error like PERIOD_NOT_FOUND.
Thanks,
Ronny
Hi Ronny,
just have a look at the screenshot in step 4 - all periods with examples 😉
Regards,
Michal Krawczyk
Hi Michael,
thank you very much. Now it works 🙂
Regards,
Ronny
Hello Michal, Good day, the XSD says that the field is "Results" (plural) but in the response of the servlet is seen to be "Result" (singular), additionally the XSD says that the fields are "qualified" but in the response of the servlet fields do not have the namespace. For example I have a interface that runs the servlet and stores the information in a table and generates error because the XSD says one thing and the answer of the servlet is another, you know that can be due, thank you very much for the support.
Daniel Valdivia
Hi Michael,
Is it possible to just fetch the message logs from PI system based on the message ID as an input ?
Regards,
Akash