Monitoring WebSphere DataPower, Part 3: Using cURL and Java

By now, you have gone through a few aspects of monitoring WebSphere® DataPower as well as configuring IBM® Tivoli® suite of products to monitor DataPower. Part 3 of this 3-part article series describes how to monitor DataPower appliances through the SOAP Configuration Management (SOMA) interface using cURL and Java as sample platforms.


Amit Tuli (, Senior IT Architect, IBM

Photo of Amit TuliAmit Tuli is an IBM Certified Senior IT Architect with IBM Global Business Services. He is an active author of articles and IBM Redbooks publications as well as many reusable assets. Amit is an active speaker at technical conferences. He has been with IBM for 13 years, having worked with product development teams, IBM research, and product services to client engagement teams. He has provided integration oriented architectural solutions to some of the largest customers in India and other countries for some of the most complex transformation programs.

Gaurav Balyan (, Middleware Specialist, IBM

Photo of Gaurav BalyanGaurav Balyan is a Middleware Specialist with diverse experience working on many middleware technologies, such as WebSphere BPM, WebSphere Message Broker, WebSphere MQ, DataPower, and WebSphere Process Server. He has led teams on many projects, applying his technical depth and breadth of knowledge. He has a Bachelor's degree in Information Technology from the Uttar Pradesh Technical University, India. He likes to spend his spare time by reading, blogging, or trekking.

Subhadeep Sarkar (, Middleware Specialist, IBM

Photo of Subhadeep SarkarSubhadeep Sarkar was part of the GTS division of IBM India for nearly 2 years. During his IBM tenure, he led the Operations Team for a telecom project as an Application Integration and Middleware Solution Specialist for the WebSphere ESB suite (MQ, Message Broker, Process Server, DataPower). He has 9 years of experience in EAI and Business Process Management with a focus on middleware technologies. He has also worked with Infosys as a Java Developer and Technical Analyst. He is a graduate of the Indian Institute of Technology, Kharagpur, India.

28 August 2013

Also available in Russian


As discussed in Part 1, SOAP Configuration Management (SOMA) is a SOAP-based interface provided by the appliance. These interfaces are language independent, and therefore, can be exposed from any client that supports SOAP/HTTP. There are two such methods for demonstration, cURL-based monitoring and Java-based monitoring. Based on your choice, environment, and other factors, you can use this article to implement various client types. We will explore the installation, configuration, and invocation perspectives on both aspects of monitoring. For details about the concept of SOMA, refer to Part 1 of the series.

cURL based monitoring

cURL is a client side library that you can install on UNIX or Windows®, which is explained in Part 1. You can access the DataPower box via cURL to perform monitoring as well as administrative tasks (see Listing 1 and Listing 2).

Listing 1. Example of a cURL request command with options
curl –k –u user:password –d @myRequestFile.xml


Listing 2. Another example of a cURL request command with options
curl –insecure –u user:password –d @myRequestFile.xml

Options for the cURL command are:

  • insecure or k: This ignores the secure connection (SSL connections without certificate).
  • u: This specifies the user and password
  • d: This indicates HTTP post data.
  • @: This specifies the file that is sent to the XML Management Interface followed by the address of the DataPower device and the port the XML Management is running on.
  • Endpoint URI of the current version: service/mgmt/current

You can view or update the port for SOMA (if required) as shown in Figure 1, which you can access by logging in to the default domain on the DataPower appliance (one of the generic approaches).

Figure 1. XML Management Interface configuration
XML Management Interface configuration


  • The XML Management Interface (XMI) must be called using HTTPS, not HTTP.
  • To make SOMA more secure, you can configure an Access Control List (ACL) with proper authorization of the XMI.

cURL configuration

To configure cURL on any machine, you need to install the cURL library. To install cURL, you need a binary package of it that you can download.

Installing binary packages on UNIX

A normal UNIX installation is done in three or four steps (after unpacking the source archive). The sample installation procedure is shown in Listing 3. For more details about the cURL installation options, refer to the product documentation.

Listing 3. Sample install procedure
cd /usr/local/src
tar zxf curl-7.19.0.tar.gz
cd curl-7.19.0
./configure --prefix=/usr/local --with-ssl=/usr/include/openssl
make install


  • The installation requires root privileges.
  • The install cURL needs to be SSL-enabled and not restricted to the cURL version.

Java-based monitoring

In Java-based monitoring, create an HTTPS Java client to call SOMA through the XML interface. The configuration of the interface is explained in the next section. Standard request XMLs are used by the Java client to fetch the status of the requested service. The request and response formats are the same for both approaches.

Java client configuration

To configure a Java client, set up a Java HTTPS client to make a call to the SOMA service of the device using its IP address and the port of the XML Management Interface.

Invocation of SOMA using cURL and Java

Different objects of DataPower appliance are monitored by changing the class attribute of the <dp:get-status> element.

For example, to get the system usage status of the box, refer to the <dp:get-status> element with the class SystemUsage in the request message (Listing 4).

Listing 4. GetSystemUsage_Req.xml
<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<env:Envelope xmlns:env="">
        <dp:request xmlns:dp="">
            <dp:get-status class="SystemUsage"/>

Refer to <dp:get-status> in the response message (Listing 5). It indicates that the operation has performed successfully and the corresponding class elements can be obtained. The example underneath demonstrates the elements, such as Interval, Load, and Worklist of SystemUsage.

Listing 5. Response GetSystemUsage_Resp.xml
<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<env:Envelope xmlns:env="">
        <dp:response xmlns:dp="">
            <SystemUsage xmlns:env="">

Invocation using cURL

To get the system usage status of the box, the cURL command invokes the SOMA service using the input request "XML GetSystemUsage_Req.xml" and gets the response from the DataPower device in "GetSystemUsage_Resp.xml" as shown in Listing 6.

Listing 6. Response GetSystemUsage_Resp.xml
curl --insecure --data-binary @GetSystemUsage_Req.xml -u user:password > GetSystemUsage_Resp.xml

Invocation using Java

A Java HTTPS client invokes the SOMA service by sending the input SOAP as a request and gets a response back from the DataPower device. Make sure the client is HTTPS and not HTTP. There is a requisite while developing a HTTPS client and that is to manage the certificate. Listing 7 shows an example of HTTPS. This class is used to invoke the XML Management Interface over HTTPS.

Listing 7. Example of HTTPS
String ip = ""; // ipaddress of DataPower device
int port = 9550; // SOMA port number
String user = "admin";
String pass = "password";
HTTPSClient httpsCleintObj = new HTTPSClient(ip, port, user, pass);

String environmentalSensorsReq = "<env:Envelope"+

String environmentalSensorsResp =httpsCleintObj.sendMessage(environmentalSensorsReq);
System.out.println("Response from Datapower device:"+environmentalSensorsResp);

For a detailed description, see the files that are available in the Download section of the article.

Understanding the request and response structures

The request and response structures are always the same for cURL and Java-based monitoring for any client build up.

Request structure

One of the basic request types is shown in Listing 8 for the default domain.

Listing 8. Basic request type
<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<env:Envelope xmlns:env="">
        <dp:request xmlns:dp="">
            <dp:get-status class="EnvironmentalSensors"/>

To get the status of different objects, change the attribute class value in the <dp:get-status> element according to the object class value.

For example, to get the memory status, the input request element has this class value: ‘MemoryStatus’ <dp:get-status class="MemoryStatus".

To get the domain status, the input request element has this class value: ‘DomainStatus’ <dp:get-status class="DomainStatus".

Response structure

Depending upon the class value used in the request, the response xmls contains the corresponding elements inside the <dp:status> element. These are either a singular or multiple repetitive elements according to your class value. For example, the output for memory usage is singular, whereas the domain status has multiple elements corresponding to the domains that exist in the DataPower appliance.

The output needs to be parsed to fetch the appropriate metrics for further usage according to the monitoring requirements. Listing 9 shows an example of the response for the environment sensors.

Listing 9. Response for the environment sensors
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="">
   <dp:response xmlns:dp="">
      <EnvironmentalSensors xmlns:env="">
        <batteryinstalldate>Thu Jan  1 05:29:59 1970


This article series highlighted the different monitoring approaches for WebSphere DataPower appliances. Part 3, the last in this series, demonstrated the practical usage of the concepts and solution introduced in Part 1 by using the SOMA interface. You learned the high level requirements and complexity involved in using the SOMA interface.


The authors would like to thank Rakesh R. Nair for his review of the article series. Rakesh is a WebSphere DataPower specialist and has led many DataPower-based engagements for worldwide customers.


Sample Java classesJavaClient.zip5KB
Sample request XMLGetDomainStatus_Req.zip1KB
Sample response XMLGetDomainStatus_Response.zip1KB





developerWorks: Sign in

Required fields are indicated with an asterisk (*).

Need an IBM ID?
Forgot your IBM ID?

Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.


The first time you sign into developerWorks, a profile is created for you. Information in your profile (your name, country/region, and company name) is displayed to the public and will accompany any content you post, unless you opt to hide your company name. You may update your IBM account at any time.

All information submitted is secure.

Choose your display name

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

Required fields are indicated with an asterisk (*).

(Must be between 3 – 31 characters.)

By clicking Submit, you agree to the developerWorks terms of use.


All information submitted is secure.

Dig deeper into WebSphere on developerWorks

Zone=WebSphere, Tivoli (service management)
ArticleTitle=Monitoring WebSphere DataPower, Part 3: Using cURL and Java