How to get the XML data used by RPE


When reporting a problem via support or asking for help via the RPE Dev Works forum one of the first questions you will be asked is to provide the XML data used for your report.  Getting a hold of the XML data is also interesting for testing your templates while avoiding/reducing the need for server requests.

This post describes 3 ways of getting the XML data that RPE uses for the document generation.

1. Using a browser

Procedure:

  1. run a preview of the document generation
  2. copy the URL used by RPE from the console view/log file
  3. use the URL in a browser. You might be required to authenticate
  4. if you want to share/reuse that XML use the browser’s File->Save As to save the file

NOTE: do not copy&paste the content show in the browser window as that will result in invalid XML.

getXMLFile_Browser

2. Use a browser plugin

Method 1 works as long as the server does not require any extra headers to return the XML. Some providers however do require extra headers and if those are not provided a different representation of the resource, usually it’s Web UI is returned. This is the case for RQM (click on any of the links returned by a testcase feed for example).

To provide the server with the additional headers you can use any 3rd party tool that can make HTTP requests. Browser plugins are a convenient way to do so. Poster or REST Client are good examples of such plugins.

The procedure is the following:

  1. run a preview of the document generation
  2. copy the URL used by RPE from the console view/log file
  3. (optional) in the same browser instance login to the provider if needed
  4. open the plugin you want to use ( see below an example using Poster)
  5. put the URL from point 1 in the plugin and set the necessary headers ( see the documentation of the service to learn what those are).
    getXMLFile_Poster_1
  6. Make the request. Typically a GET request. The response and the content ( if the request is successful) is displayed. You can copy the content and save it to a file but make sure you preserve the encoding.
    getXMLFile_Poster_2

3. Using RPE’s Data Preview (recommended)

Data preview is a feature introduced in RPE 1.2 and is the easiest method to get the data.

I recommend using this method #3, RPE’s Data Preview, as it’s the closest to what RPE does at runtime (authentication included). This method also has the added advantage works for DOORS data sources.

Data preview can be used both from Launcher’s docspec view or from Studio’s schema view. I will describe the Launcher  scenario as its the more common and powerful one:

  1. open your document specification
  2. select the data source you want to test
  3. right click it and select “Preview data source”
    getXMLFile_Preview_1
  4. if your data source was configured the URL from the docspec is pre-populated in the Root URL field. you can chance it if needed
    getXMLFile_Preview_2
  5. click preview. If the service requires authentication and authentication was provided in the docspec RPE will try to use it. If the service requires authentication but there is no credential information in the docspec or the information is incorrect, RPE will prompt you to provide the correct credentials. Similarly RPE uses any accept headers defined in the docspec for that data source.
    NOTE: the changes you make in this dialog do NOT affect the docspec
  6. if the request is successful the content is shown in the browser embedded in the dialog. Click save to save the file ( this is similar to browser’s save function)
    getXMLFile_Preview_3
  7. The URL field is populated by RPE with the actual request it makes to the server and this request can be different from the base one. For a REST data source the actual requests will include the fields argument.
Advertisements

Author: Dragos Cojocari

Architect for Rational Publishing Engine

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s