Skip to main content

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

The first time you sign into developerWorks, a profile is created for you. Select information in your developerWorks profile is displayed to the public, but you may edit the information at any time. Your first name, last name (unless you choose to hide them), and display name will accompany the content that you post.

All information submitted is secure.

  • Close [x]

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.

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

All information submitted is secure.

  • Close [x]

Develop a Blackberry device implementation with Web Services Distributed Management

Barry Atkins, Advisory Programmer, IBM
Barry Atkins is an advisory software developer working for the Emerging Technologies Toolkit team with IBM. You can contact him at barrya@us.ibm.com.

Summary:  Explore a minimal implementation of Web Services Distributed Management (WSDM) specifications on a Blackberry™ device, demonstrating that you can implement WSDM and its requisite specifications on resource-constrained devices.

Date:  25 Mar 2005
Level:  Intermediate

Activity:  14950 views
Comments:  

Introduction

The Web Services Distributed Management (WSDM) specifications define how management of any resource can be accessed through web services protocols, and how web services themselves can be managed using the same protocol. WSDM Management Using Web Services (MUWS) 1.0 defines how to represent and access the manageability interfaces of resources as web services. This article describes a proof-of-concept implementation of WSDM on a Blackberry™ device. Manageability is defined as the ability of a resource (in this case, a pervasive device) to be remotely managed. Manageability interfaces support control functions (stop, start, restart, shutdown, and so on) and monitoring functions (performance, state, and so on).


Why on a pervasive device?

A simple implementation of WSDM was implemented on a mobile device to demonstrate that you can implement WSDM and its requisite specifications on resource-constrained devices. WSDM, Web Services Addressing (WSA), Web Services Resource Framework (WSRF), Web Services Notification (WSN ), and Web Services Resource Lifetime (WSRL) were designed to be composable to allow for minimal implementation requirements in simple or constrained implementations. They also provide composable functionality required to support complex, large-scale systems.

What was implemented?

The following methods were implemented on the device:

From WS-ResourceFramework:

  • Element[] GetResourceProperty(QName qname)
  • Element[] SetResourceProperty (Update [])
  • GetMultipleResourceProperties(QName qnames[])

From WS-BaseNotification:

  • Subscribe
  • Destroy

The following properties were implemented for GetResourceProperty and GetMultipleResourceProperties:


Listing 1. Available properties
Serial Number              Device serial number, prefixed by the manufacture
                                       ("RIM2100000A")
Date         	           Device date
Time                       Device time
CodeModuleSize             Total code size, in bytes, of all installed modules
BatteryLevel         	   A percentage of battery life remaining
BatteryStatus          	   "Charging", "Normal", "Too Hot", etc
AllocatedStorage           Allocated storage, in bytes
FreeStorage         	   Free storage, in bytes
Identity                   Device identity ("RIM" + device serial number)
ManageabilityCapability    Returns capability URIs

Of the above, only Time and Date are mutable, and all others are read-only. Attempting to change the value of any of the other properties results in an InvalidResourcePropertyQNameFault.

The optional WSRF QueryResourceProperties method was not implemented; integrating an XPath interpreter was considered beyond scope of this implementation and unnecessary on resource-constrained devices.

The implementation was taken from the example implemented in the Emerging Technologies Toolkit 2.2 (ETTK), which was re-written to conform to the J2ME platform implemented on the Blackberry device. References to various J2EE classes were replaced with kSOAP or the J2ME supplied classes, if available. The resulting code consisted of 52 source files in 9 packages, compiled to 118K (in 5 Blackberry-format .COD files). Of this, 63K was the kSOAP2 soap engine, 18K in UI and configuration, and 36K for the WSDM/WSRF/WS-N code.


Scenario components

The Blackberry device is inaccessible directly through an IP address, or hostname, so an intermediary known as the WirelessDeviceGateway (WDG) was implemented. The WDG hides logic for communicating with a variety of handheld devices on behalf of the caller. The WDG's URL is the Endpoint Reference (EPR) for web services calls to the device. The URL contains the device's identifier which is comprised of the device's serial number appended to the manufacturer name (RIM):

http:\\myServer\WirelessDeviceGateway\RIM2100000A

The WDG forwards the request to the device and then returns the result. If the device is offline, a time-out occurs.

On the Blackberry device, a tiny SOAP server (using kSOAP2) receives the SOAP envelope, marshals the contents, invokes the requested function, and generates a returned soap envelope. This background server component runs transparently on the device and starts automatically when the device is powered on.

A second component, the WSDM Controller, provides simple feedback from the server and configuration of the server itself. The two processes communicate using a Blackberry-specific event mechanism.


Figure 1. WSDM controller application and menu
WSDM controller application and menu

TinyWSDM controller main menu

  • Stop server: stops the soap server.
  • Start server: starts the soap server.
  • WDGSetup: invokes the WirelessDeviceGateway dialog (to specify where the WirelessDeviceGateway resides).
  • Subscriptions: shows all active subscriptions.
  • Clear Subscriptions: destroys all subscriptions.
  • Notify: forcibly generates a sample Notification message (for testing).
  • Close: terminates the application.

When a web service on the device is invoked, feedback is displayed as shown in Figure 2:


Figure 2. WSDM controller application
WSDM controller application

Running the scenario

A Web interface has been designed to test the hosted services on the device. The interface makes it easy to make changes, and the following three figures show how you can walk through the process of changing the time through the SetResourceProperty.


Figure 3. GetResourceProperty
GetResourceProperty

Figure 4. GetMultipleResourceProperties
GetMultipleResourceProperties

Figure 5. SetResourceProperty
SetResourceProperty

Figure 6 shows the result on the device as a result of changing the time through SetResourceProperty.


Figure 6. SetResourceProperty on device
SetResourcePropertyonDevice

Figure 7. GetResourcePropertyDocument
GetResourcePropertyDocument

Example management scenario

BobCo is having problems with the Blackberry devices being used for non-business reasons. Extra software is causing the business software for tracking inventory to remotely fail and then needing to be reinstalled. This is a problem in the field because field personnel don't have the skills (install/uninstall/configuration/debugging) and have to wait until they get to the office and then wait for support to reinstall the software. As a result, a new corporate policy forbids any non-corporate software on the Blackberry devices. Of course, it's not being obeyed, so an automated software inventory control system was installed using WSDM. This system detects new software installations and uninstalls any non-corporate software.

A subscription is generated for the topic CodeModuleSize_Change in Figure 8.


Figure 8. Subscription
Subscription

Clicking the Notifications button opens the NotificationConsumer page in a new browser window:


Figure 9. Notification monitor
Notification monitor

When the device owner installs or deletes an application, the CodeModuleSize property is modified. A notification is generated, and sent to the NotificationConsumer specified in the subscription for this topic.


Figure 10. Subscription notifications
Subscription notifications

Specifically, the device's CodeModuleSize property changes as the result of an application installation. This results in the generation of a ManagementEvent, containing a propertyValueChangeNotification event. The NotificationConsumer, upon receipt of this event, retrieves the list of installed applications on the device. This list is compared through a pre-configured policy to a list of legal and illegal applications. If an offending application (in this case, HelloWorld) is found, the NotificationConsumer invokes an UninstallApplication web service on the device and the following pop-up is displayed :


Figure 11. Notification
Notification

The following is a sample MUWS ManagementEvent, indicating that the code module size has changed on the device RIM210000A:

MUWS Notification ManagementEvent


 <ManagementEvent xmlns="">
    <eventId>
        http://pda.rim
    </eventId>
    <reportTime>
        2005-02-16T18:50:54.300Z
    </reportTime>
    <SourceComponent>
        <wsa:ComponentAddress xmlns:wsa=
        "http://schemas.xmlsoap.org/ws/2004/08/addressing">
            <wsa:Address>                
                http://my.wirelessdevicegateway.com/WirelessDeviceGateway/RIM2100000a
            </wsa:Address>
            <wsa:ReferenceProperties>
            </wsa:ReferenceProperties>
        </wsa:ComponentAddress>
    </SourceComponent>
    <ReporterComponent>
        <wsa:ComponentAddress xmlns:wsa=
        "http://schemas.xmlsoap.org/ws/2004/08/addressing">
            <wsa:Address>                
            http://my.wirelessdevicegateway.com/WirelessDeviceGateway/RIM2100000a
            </wsa:Address>
            <wsa:ReferenceProperties>
            </wsa:ReferenceProperties>
        </wsa:ComponentAddress>
    </ReporterComponent>
	  <PropertyValueChangeNotification>
        <CodeModuleSize>
            <oldvalue>
                12351642
            </oldvalue>
        </CodeModuleSize>
        <CodeModuleSize>
            <newvalue>
                12396123
            </newvalue>
        </CodeModuleSize>
    </PropertyValueChangeNotification>
    <Details>
        <Topic>
            CodeModuleSize_Change        
        </Topic>
        <Device>
            RIM2100000a
        </Device>
    </Details>
</ManagementEvent>


Subscriptions are destroyed through the Unsubscribe command, as shown in Figure 12.


Figure 12. Destroying a subscription
Destroy

Existing subscriptions can also be dislplayed with the Show Subscriptions command, as you can see in Figure 13.


Figure 13. Viewing subscriptions
ViewSubscriptions

Conclusion

The WSDM 1.0 specifications have set forth the foundation for a management platform using web services. WSDM can simplify remote systems management for a variety of devices in industry-standard, device-independent fashion. This proof-of-concept implementation demonstrates that you can implement these specifications on resource-constrained devices.


Resources

About the author

Barry Atkins is an advisory software developer working for the Emerging Technologies Toolkit team with IBM. You can contact him at barrya@us.ibm.com.

Report abuse help

Report abuse

Thank you. This entry has been flagged for moderator attention.


Report abuse help

Report abuse

Report abuse submission failed. Please try again later.


developerWorks: Sign in


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. Select information in your developerWorks profile is displayed to the public, but you may edit the information at any time. Your first name, last name (unless you choose to hide them), and display name will accompany the content that you post.

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.

(Must be between 3 – 31 characters.)

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

 


Rate this article

Comments

Help: Update or add to My dW interests

What's this?

This little timesaver lets you update your My developerWorks profile with just one click! The general subject of this content (AIX and UNIX, Information Management, Lotus, Rational, Tivoli, WebSphere, Java, Linux, Open source, SOA and Web services, Web development, or XML) will be added to the interests section of your profile, if it's not there already. You only need to be logged in to My developerWorks.

And what's the point of adding your interests to your profile? That's how you find other users with the same interests as yours, and see what they're reading and contributing to the community. Your interests also help us recommend relevant developerWorks content to you.

View your My developerWorks profile

Return from help

Help: Remove from My dW interests

What's this?

Removing this interest does not alter your profile, but rather removes this piece of content from a list of all content for which you've indicated interest. In a future enhancement to My developerWorks, you'll be able to see a record of that content.

View your My developerWorks profile

Return from help

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=SOA and web services,
ArticleID=56856
ArticleTitle=Develop a Blackberry device implementation with Web Services Distributed Management
publish-date=03252005
author1-email=barrya@us.ibm.com
author1-email-cc=

Tags

Help
Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

For articles in technology zones (such as Java technology, Linux, Open source, XML), Popular tags shows the top tags for all technology zones. For articles in product zones (such as Info Mgmt, Rational, WebSphere), Popular tags shows the top tags for just that product zone.

For articles in technology zones (such as Java technology, Linux, Open source, XML), My tags shows your tags for all technology zones. For articles in product zones (such as Info Mgmt, Rational, WebSphere), My tags shows your tags for just that product zone.

Use the search field to find all types of content in My developerWorks with that tag. Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere). My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Try IBM PureSystems. No charge.

Special offers