Before you start
This series demonstrates how to incorporate security in Java 2, Micro Edition (J2ME)-based wireless access to Web services. We use the following components and technologies together in a J2ME MIDlet:
- Web ervices APIs (WSA) for J2ME
- Cryptography
- XML Digital Signature (XMLDS)
- Java Card
In Part 1 of this series, you looked at how Web Services API (WSA) stub classes work. Part 2 demonstrated how to enhance WSA stub classes and integrate other technology components such as cryptography and XML signatures into WSA stub classes.
Part 3 starts by implementing Base64 encoding and signature calculation algorithms. Part 3 also demonstrates a comprehensive testing arrangement that you can use to test the secure J2ME-based Web services client. We'll conclude by putting together all the concepts into a "stub enhancer tool." This tool enhances the functionality of WSA stub classes by incorporating security features.
In Part 2 of this tutorial series, you enhanced WSA stub classes. Part 2 also presented four helper classes named CanonicalAuthor, SHA1DigestCalculator, Base64Encoder, and SignatureCalculator. In Part 2 you also implemented two of the helper classes: CanonicalAuthor and SHA1DigestCalculator.
In Part 3 we implement the rest of the helper classes: Base64Encoder and SignatureCalculator. Part 3 then puts all the stub and helper classes into a test arrangement. This will let you test your J2ME-based secure Web services clients easily.
This tutorial series concludes by developing a stub enhancer tool. The tool is designed to bear most of the manual programming burden of enhancing stub classes and generating helper classes. You can use the stub enhancer tool to save most of your effort in building J2ME-based secure Web services clients.
- Read Part 1 and Part 2 of this series.
- You need a basic understanding of the various technology components this series discusses. Specifically, the following background is assumed:
- You should be familiar with Java programming and have a basic understanding of J2ME MIDlets.
- WSA uses Web Services Definition Language (WSDL) and Simple Object Access Protocol (SOAP). Therefore, you need to know how WSDL interfaces are mapped to SOAP method invocation calls.
- Some background in XML signatures will be useful.
See Resources for several excellent developerWorks articles and tutorials on these topics.
The primary purpose of this series of tutorials is to help you develop wireless access to your Web services. The main focus is security, but you can use the WSA concepts presented here to develop any type of wireless clients for your Web services.
This third part of the series demonstrates how to implement a Base64 encoding algorithm in a memory-constrained wireless device. So, this tutorial can also help you implement similar algorithms in wireless devices.
This part also demonstrates building test mechanisms that you can use while trying wireless access to your Web services. You can use this tutorial's test mechanism or develop similar testing arrangements for your Web services.
The stub enhancer tool discussed at the end of this tutorial demonstrates how to build automated solutions for WSA stub enhancement. You can use the stub enhancer tool to save development time in building J2ME-based secure Web services applications.
Part 3 is organized in the following seven sections:
- Tutorial introduction
- Demonstration of implementing a Base64-encoded algorithm in J2ME
- Explanation of how to communicate with Java Card applications for J2ME MIDlets
- Demonstration of how to install Java Card applications
- Demonstration of building a Java Card application capable of computing cryptographic signature values
- Discussion of how to build a stub enhancer tool that can perform most of the programming hard work required to enhance WSA stub classes
- Wrap-up


