Of course, the lead approach was to use the browser to access mobile friendly Domino applications. It's not a very exciting demo though – you take a domino database and scrunch it down so it fits the smaller screen and uses rich media sparingly.
The other option I discussed was to create Web Services in a Domino application then use Research In Motion's MDS Runtime technology to access the operations exposed by these services. It was a truly amazing demonstration to illustrate the web service then build a rich (non-browser) BlackBerry application that talked to it in minutes. With Research In Motion's recent announcement of the end of life of MDS Runtime and associated development tools – developers need another option for building a (non-browser) rich client application that talks to web services. I'm sure there's a way to do it from a BlackBerry Widget but I still haven't had a chance to play with that technology yet. The only other option is to consume the Web Service from a Java application and for my presentation this year at the View Domino Developer conference I built a Java version of the application I'd been demonstration for years using MDS Runtime.
A few weeks ago I posted here that I was going to write some articles about how to build that application. From the responses I received, it seems that there are a lot of you who are interested in the information, so here we go…
I'm going to split this topic into three parts:
Part 1: (this article) How to build the Domino Web Service used in the sample application
Part 2: How to create the Web Service Stub called by the Java application
Part 3: How to build the Java application (for BlackBerry of course) that talks to the service
Before we begin, it's important to highlight that Research In Motion has published a lot of information about connecting to a Domino application from a BlackBerry device – be sure to check out na.blackberry.com/eng/developers/started/develop/ibm.jsp for additional information on the topic.
Learning How to Build a Domino Web Service
When I first set about learning about how to build Web Services in Domino, there really wasn't much information available. The first I'd heard about it was from some old articles that Gary Devendorf (now at Microsoft, go figure) on how to do web services in ND6 (that's Notes & Domino 6 for the uninitiated). It was quite a mess; you had to build an agent that could read and write XML and had to hand craft the service's WSDL to use with some tools.
With the release of Domino 7, IBM made it much easier to build web services. Ultimately, the way I learned how to create the sample application in this article was from reading this: https://www.ibm.com/developerworks/lotus/library/nd7-webservices/. If you don't know how to do web services in Domino, that's a great place to start reading.
About the Project
When I first started looking for a good sample application for Domino developers I looked for something that would appeal to the widest audience of developer. I thought about how every Domino environment I'd ever worked with had at least one (sometimes more) additional contact databases outside of the standard Domino Directory. Since the BlackBerry already provided search capabilities against the Domino Directory, it seemed like a good idea to build a web service that would allow BlackBerry applications to lookup contacts in one of these other databases.
Assuming that most of these additional contact databases were created against a copy of the Domino Directory, I built the web service using that template as a starting point. If you use this web service against a database that wasn't built off of that template, you will have to change the view, column and field names to match the needs of the target database.
Building the Web Service
The web service is used to lookup contact information for a particular person in the database. It contains two operations: GetUserList and GetUserDetails. GetUserList takes as a parameter a portion of the last name being searched for and returns an array containing the names of all contacts who's last name begins with the specified string. GetUserDetails takes as a parameter the name of a contact and returns a UserInfo object containing several fields from the selected Contact document in the database.
Let's get started building the web service. To do this, you will need to use Domino Designer 7 or higher – the screen shots in this article were taken in Domino Designer 8.5. The database you're creating will need to reside on a Domino server with the HTTP task enabled in order to be able to be accessed by the BlackBerry Java application we'll create in Part 3.
Open Domino Designer and open the contact database in design mode (it would be best to do this in a template, but that's up to you). In designer, expand the 'Code' section of the design element hierarchy as shown in Figure 1. Right-click on 'Web Services Providers' and select 'New Web Service Provider…' as shown in the figure.