SlideShare a Scribd company logo
1 of 81
Download to read offline
Web Services Bootcamp
Bill Buchan - HADSL




          ®
Agenda
 Introduction

 Web Services Overview

 Using Domino to provide Web Services
    LotusScript in Domino v7 and v8
    Java using a servlet in Domino 5 upwards
    Using an agent
    REST

 Using Notes to consume Web Services
    LotusScript in Notes 8
    COM
    Stubby in Notes 7

 Summary, Q+A
Introduction
  I am Bill Buchan. I am:
     A blogger - http://www.billbuchan.com
         I was blogging when it was called ‘Talking rubbish on the internet’.
         Some things never change.
     A principal of HADSL - http://www.hadsl.com
     A Notes veteran of some 14 years
     Old. Its my birthday today, so no loud noises...


  You are
     Lotus Domino developers
     Interested in starting or enhancing Web Services in your environment
     Familiar with LotusScript, and perhaps Java
This is a JumpStart
  This takes you from a low level in a subject to a good level of expertise
  Little existing knowledge is assumed
      But we assume your are developers, and are familiar with LotusScript

  Its 2 hours long
      So get comfortable, visit the toilet

  People have paid to come to this session
      So as a matter of courtesy, please switch off all mobile phones, etc
      If your phone goes off, you will have to buy a drink for everyone in the room!

  Feel free to ask some questions as we go along
      But I reserve the right to leave some answers till the end

  I will be doing live demonstrations
      So feel free to laugh if they break!
Agenda
 Introduction

 Web Services Overview

 Using Domino to provide Web Services
    LotusScript in Domino v7 and v8
    Java using a servlet in Domino 5 upwards
    Using an agent
    REST

 Using Notes to consume Web Services
    LotusScript in Notes 8
    COM
    Stubby in Notes 7

 Summary, Q+A
A quick Web Services overview
  Web services are:
      A standard application to application protocol for exchanging structured data
          Usually (but not always) using the http protocol
          Usually (but not always) using XML
          Usually we provide meta-information on what our service will do, using a language called
          WSDL (Web Service Description Language) – formatted in XML.

  Web services are:
          Language independent
          Platform independent
          Data format representation independent


  But hopefully you all knew this already...
Web Services Architecture
  The players:


     The Web Service server
        Can answer questions on what it can do
        Can accept requests from Web Service clients
        Can respond to requests from Web service clients

     The Web Service client (or consumer)‫‏‬
        Knows where the web service server is located
        Knows the services that it requires
        Knows how to prepare a Web Services Query
        Knows how to interpret the returned data
Web Services Protocol
  A typical web service session looks like:


     Client to Web Service Server
         “Tell me the answer to this question”

     Web Service Server
       “Here it is”


  Conclusion:
     The clients drive the conversation
     The Server cannot initiate a conversation with the client.
Web Services Protocol (in more detail)‫‏‬
  The Web Services Protocol:
     The client decides it needs to ask the server for some information
     It constructs the relevant XML based web services query (either dynamically or in
     a static fashion depending on the complexity of the application)‫‏‬
     It then connects to the Web Service Server
          Pushing the web request up as an HTTP 'Post' request
          It waits for a response
     The Web service server then 'Posts' back an XML payload representing the answer
     The client then unpacks and interprets the data.
This sounds hard...
  Not really.
     Its a combination of web protocol and XML construction and unpacking
     Most of the hard work is done for you by the various Web Service servers and
     Consumers
     Its fairly easy to debug using the correct tools
Lets prepare a sample application
  Fairly simple Domino Contact Database
     A single ‘Contact’ form with some information
     Not meant to be a ‘real-world’ example
     Its here to demonstrate the techniques




  All example code is in the database
     Simple to figure out and ‘research’
     Probably isnt best practice!
Example Database: Contacts.nsf
Example Database: Contacts.nsf
How do we test a web service?
  I recommend SoapUI
     Its free!
     http://www.soapui.org

  It allows you to interrogate a web service
     And build test case with real data
SoapUI: Example Screenshot
Agenda
 Introduction

 Web Services Overview

 Using Domino to provide Web Services
    LotusScript in Domino v7 and v8
    Java using a servlet in Domino 5 upwards
    Using an agent
    REST

 Using Notes to consume Web Services
    LotusScript in Notes 8
    COM
    Stubby in Notes 7

 Summary, Q+A
Domino as a Web Service Server
  Three different methods:
     Using LotusScript as a Web service
     Coding a Java Servlet
     Using an agent

  By far the simplest is to use a LotusScript Web Service
     The majority of the work is done for you!

  Servlets should be avoided unless
     You are running on Domino v6.5.x or older
     You absolutely require persistence

  Agents are good for
     Very low transaction services
     Simple services
Agenda
 Introduction

 Web Services Overview

 Using Domino to provide Web Services
    LotusScript in Domino v7 and v8
    Java using a servlet in Domino 5 upwards
    Using an agent
    REST

 Using Notes to consume Web Services
    LotusScript in Notes 8
    COM
    Stubby in Notes 7

 Summary, Q+A
LotusScript Web Services in nd7 and nd8
  Introduced in Lotus Domino 7

  Robust

  Code the web service using LotusScript

  Fairly high performance but
     Remember: Lack of persistence between calls, so
        Be aware of what your code is doing!
        Use ‘Agent Profiling’ to see timings…
Profiling a LotusScript Web Service
  LotusScript web services are very similar to LotusScript agents
     So you can profile them.
     Enable Profiling on the Web
     Services Properties tab




     View the last run profile:
        Right click on the Web Service
        View Profile Results
A Sample Profile
  This shows how long the agent took to run, and how long the agent
  spent inside the Notes Object Interface
     In our case, 761ms total, and 0ms within NOI
     One call to CurrentDatabase, and one call to Title.




     Obviously, this wasn’t a very interesting web service call…
Designing a Web Service
  Spend time thinking about how your consumer will use this web
  service.
     More time thinking, less time coding
     You do NOT want to change this web service interface once its published
         Instead - roll out a new web service
     Think through client use cases
     Remember - you can use LotusScript to perform complex business rules, and
     provide a summary of data to your consumer
         Don’t assume the consumer can perform a lot of data manipulation
          – BlackBerry smartphones / Windows Mobile ?

  Best to put complex code in a script library, and just surface it via a
  web service
        It means you can put a normal agent ‘test harness’ around it and debug it
        Remote Debugging might not work…
Contacts.nsf - Web Service
  In our case we wish to:
     Be able to list all users
         By Name
         By Department
     Be able to get details on a particular user
     Be able to search for users

  Do we
     Pass all fields back as web service items?
     Pass back an array of fields?

  In this case, we pass back Web Service Items
     Assume data mapping knowledge and responsibility.
Contacts.nsf - Web Service Design
  We design our web service interface within a ‘Class’ in LotusScript.
     At this point, you probably wished that you studied the Object Orientated
     LotusScript sessions I used to give…
     Good example presentations on my personal blog presentations page
         http://www.billbuchan.com/web.nsf/plinks/BBUN6MQECQ.htm

  Our web service will expose all ‘public’ methods and properties
     We do not have to put all the code in one ‘class’
     Beware of extending existing classes - you might expose more than you want!
        Beware over-exposure…
Contacts.nsf - Web Service Design
  LotusScript does NOT allow functions to return Arrays.
     This is a language limitation, not a Web Service Limitation
     It can return simple types
     A variant (but since web services don’t support ‘em, we cant use ‘em)
     Instances of other classes…

  We need to use arrays to return results
     For instance, we need to return an array of Zero or more entries to list our
     users.
     How do we do that?

  We can define a class and return an instance of that class…
Web Service Design - returning complex types
  We can define a class called              Class returnArray
  ‘ReturnArray’ which has a single             Public S() As
  array as a public member.                 String
      The constructor initialises the          Sub new
      array so that it has one blank entry.       Redim S(0)
  We can then populate this array                 S(0) = ""
   with one or more entries.                   End Sub
                                             End Class
  LotusScript Web services only supports single dimension arrays.

  Nd7 supports arrays with one element or more - nd8 supports
  ‘empty’ arrays.
Web Services Design - returning complex types…
  We shall return our Person                 Class Person
  contact record using a class.                  Public FirstName As String
     We DON’T have a constructor                 Public MiddleInitials As String
     All elements are Public - so it’ll be       Public LastName As String
     exposed to the Web Service as               Public FullName As String
     data.
     Our property names will be used             Public Telephone As String
     by the web service as field names           Public Cellphone As String
          Since LotusScript is case              Public eMail As String
          insensitive, the web service           Public HomePhone As String
          field names will be
          UPPERCASE.
                                                 Public Department as String

                                                Public Notes As String
                                              End Class
Demo Time!




  Finally! A Demo!
Web Services Design - lets make it better
  We need to add:
     Logging. We need to know when it works, and importantly, when it does not
     Error Handling. We need to pass errors back to the consumer
     Security. We might want to harden this service somewhat

  We committed the following sins:
     We put all the code in the web service itself, making it hard to test. Best to
     consider embedding most of the code in script libraries
     We’ve tightly bound the data structures in our data to our web service
        If we add more fields to our contact record - we shall have to change the
        web service. And therefore, all our clients will have to be checked and/or
        recompiled.
        If the data set is likely to change, construct a more flexible data-mapping
        schema
ND7 and ND8 differences
  Web services built or compiled in Notes 8 Designer WONT run on
  ND7 anymore!




  So be careful about what web services you host on which servers,
  and which version of designer you use.
     Just bear this version difference in the same manner as all other version
     differences.
ND7 and ND8 differences
  In ND7, the class used for the web service has to reside in the web
  service design element. In ND8, this can be in a script library.
     This means that for complex services, you can place all the business code in a
     script library, allowing simple construction of a test harness.

  ND8 now supports code in Java Libraries

  ND8 supports more error handling SOAP elements

  ND8 supports ‘empty’ arrays - nd7 does not
Testing this web service using SoapUI




  Demo: Lets go test this service with SoapUI
Web Services Design - lets talk about WSDL
  WSDL - Web Services Description Language
     Its an XML document
     You can query a web service for its WSDL,
     You build a web service consumer from the WSDL

  Lotus Domino LotusScript Web Services WSDL
     Is automatically generated for you
     You can query a LotusScript Web Service by passing a URL:
         http://<host>/<directory>/<database>/<web service>?WSDL
         It will then return an XML document showing the WSDL
WSDL: Example
  The first section
  outlines the data
  objects we shall
  pass from this
  service
     You can see our
     returnArray &
     Person objects

  Note that our
  variables default to
  Uppercase - this is a
  side-effect of
  LotusScript being a
  non-case sensitive
  language
WSDL: Example
  The second section of our
  WSDL deals with the Web
  Services Messages that
  will be sent to the Web
  service, and the types that
  get returned.
WSDL: Example
 The port section associates
 input messages - function
 calls - with their return types.
WSDL: Example
  The binding section defines
  all input and output
  operations
WSDL: Example
  The Service section
     Connects the service to the binding
     Gives a fully formed URL for the service
WSDL
 Why mention that in such detail?


    LotusScript Web services does all the work.




    The following web service engines do NOT.
       And it seems like a lot of work…
Agenda
 Introduction

 Web Services Overview

 Using Domino to provide Web Services
    LotusScript in Domino v7 and v8
    Java using a servlet in Domino 5 upwards
    Using an agent
    REST

 Using Notes to consume Web Services
    LotusScript in Notes 8
    COM
    Stubby in Notes 7

 Summary, Q+A
Java Servlet Web Service: Overview
  Why construct a Web Service in a Servlet?
     Persistence
         The LotusScript web engine does not persist data between calls. Complex
         operations can take advantage of persistent memory objects in Java
     Performance
         Because of persistence, you may be able to support many more
         simultaneous users

  What are the downsides?
     Very old servlet engine (Servlet v1.1) in Domino. Very little control.
     Old versions of Java
         Example. Nd6 uses Java 1.3.1, which is no longer supported
     Complex
         You have to do lots more work to achieve the same goals
        More difficult to support
Java Servlet Web Service: Introduction
  So how do servlets work?
     Compiled Java code placed in Dominoservlet directory in server data directory
     Servlet Engine enabled on server document
     When http engine loads, it loads any defined servlets
         To reload a servlet, restart the http process
     Uses ‘servlet.properties’ file in data directory to
         Map servlet URLs to servlets
         Load servlets into memory
     I use eclipse to build the servlet
         You might be able to debug in real-time
     You can optionally link to the Notes/Domino Java interface to examine data
Java Servlet Engine: servlet.properties file
  The text file ‘servlet.properties’ exists in the domino directory

 servlet.Contact.code=Contact
  # Supply the intitialisation arguments
  # Server = the name of this server
  # Db = the Database path for the web service database
  # Name = the alias name you've given the servlet
  # WSDL = the name of the WSDL file.
  #      (remember to double up "" characters to "" !!!)

 # This should all be in one line…
   servlet.Contact.initArgs=Db=customers/ls2008/Contacts.nsf,Server=idm-
 demo1/HADSL,Name=Contact,WSDL=c:LotusDominoidm-
 demo1dominoservletContacts.wsdl


  # Load this servlet at startup
  servlets.startup=Contact
Java Servlet: Architecture
  The Servlet will
     On startup, will read parameters from servlet.properties.
     Respond to http ‘get’ requests and return the WSDL for this service
        For convenience, we’ll store this in a file
     Respond to http ‘post’ requests
        Parse incoming SOAP for requests
        Return results as XML
Java Servlet Engine: Code




  Lets walk through the code…
Java Servlet Engine: Summary
  It’s a LOT of work

  Its fairly normal Java

  Its quite hard to change or add new functionality

  Remember: The Servlet engine in Domino is old, and fairly crude.
     You might wish to use a more modern Servlet engine such as Websphere.
Agenda
 Introduction

 Web Services Overview

 Using Domino to provide Web Services
    LotusScript in Domino v7 and v8
    Java using a servlet in Domino 5 upwards
    Using an agent
    REST

 Using Notes to consume Web Services
    LotusScript in Notes 8
    COM
    Stubby in Notes 7

 Summary, Q+A
Agent based Web Service Engine
  Now that we understand how a web service works, we can
  construct an Agent based Web Service

  Pros
     Can run in Domino 6
     Straightforward

  Cons
     Performance
     Complex code
Agent Based Server - Architecture
  A single web-based agent

  Accepts requests
     GET Requests tend to be WSDL requests
     POST Requests are SOAP Requests

  We can use the NotesDOM parser to decode the incoming SOAP
     Fairly complex code

  We can just use “Print” statements to output the results
     Fairly ‘brittle’.
     Tightly bound to the Web Service
Agent Based Server - Demo




  Demo: Lets see this in action
Agent Based Server - Summary
  Lets look at the code




  Pros
     No additional server code required
     It can run on Domino 6.

  Cons
     The code is brittle, unpleasant
     Only do this if you have no other, better, web servers available
Agenda
 Introduction

 Web Services Overview

 Using Domino to provide Web Services
    LotusScript in Domino v7 and v8
    Java using a servlet in Domino 5 upwards
    Using an agent
    REST

 Using Notes to consume Web Services
    LotusScript in Notes 8
    COM
    Stubby in Notes 7

 Summary, Q+A
REST
 REST - Representational State Transition
    Its an architectural proposal - not a standard

 In terms of Web Services it means
    The query part of the web service is represented using an URL. For Example:
       http://myserver.com/service/ListContacts
       http://myserver.com/service/ContactInfo/Fred+Flintstone
       http://myserver.com/service/ListContactsByDepartment/Sales

 Who does it help?
    With simple web services, you spend less time parsing XML
    Very simple to implement consumer code. No incoming XML payload.
REST
 We pass in parameters on the URL.

 Our URL needs to start with
    http://dominserver/path/database.nsf/DesignElement….
    Any URL customisation needs to happen after the DesignElement. EG:
        http://ibm.com/db.nsf/Agent?OpenAgent&Cmd=ListUsers
        http://ibm.com/db.nsf/Agent?OpenAgent
        &Cmd=GetUser&Name=Fred+Flintstone

  In our servlet, or in our Agent
    We can intercept the incoming URL, decode it, and take action.
Agenda
 Introduction

 Web Services Overview

 Using Domino to provide Web Services
    LotusScript in Domino v7 and v8
    Java using a servlet in Domino 5 upwards
    Using an agent
    REST

 Using Notes to consume Web Services
    LotusScript in Notes 8
    COM
    Stubby in Notes 7

 Summary, Q+A
Consuming a web service - overview
  Why consume web services?
     To gain access to information in other systems
     To prevent the syncronisation and replication of external data sources to Notes
     Real time, up to date data lookup

  Where?
     We could use a scheduled Java agent in Domino to interrogate external services
        No UI means you have to monitor and check
     We could use client-driven code on the client workstation
        Be aware of network issues between the clients and the remote service
         – Large corporate intranets are rarely stable and predictable
         – Predict & accommodate remote service outage
        Any issues are immediately visible to the users
         – Empowering or Confusing?
Consuming a web service - overview
  Security
     Remote web services may require
        Username/password login
        Encrypted username/password pairs in data
        SSL.

  Things change
     You may have to change your web service consumer to accommodate this
     The remote web service may move
     When designing, don’t hard-code…
Consuming a web service - examples
  In the following sections,
     We shall use the web services we constructed earlier as a target
     We wont use any security features for simplicity
     We’re coding to demonstrate technique, not best practices
        So by all means reuse this code, but make it production-strength
         – Add Error handling
         – Remove hard-coding
         – Add Logging
Agenda
 Introduction
 Web Services Overview
 Using Domino to provide Web Services
    LotusScript in Domino v7 and v8
    Java using a servlet in Domino 5 upwards
    Using an agent
    REST

 Using Notes to consume Web Services
    LotusScript in Notes 8
    COM
    Stubby in Notes 7

 Summary, Q+A
Consuming Web Services with LotusScript
  Summary:
     Notes 8
     Its very simple
     It works in LotusScript and in Java
     It does a lot of work for you


  How do I construct a Web Service Consumer in LotusScript?
     Create a new, empty script library
     Click on the Import WSDL button
     It creates a Class definition
     You can then “use” the script library and class.
Consuming Web Services using LotusScript
  Create a new LotusScript Script Library:




  Click on the WSDL button…
Consuming Web Services with LotusScript
  It needs a WSDL file. What's that?
      You can open the WSDL definition for
      your web service in your browser
      Use View Source, and save that as
      a WSDL file.
      Select it…




  Designer will then construct               Sub Initialize
  helper classes and a main                       Dim C As New Contacts
  class which we can then call
                                                 Dim V As Variant
                                                 Set V = C.listUsers()

                                                Forall thisUser In V.S
                                                     Print "Found User: " + thisUser
  That’s it!
                                                End Forall
                                              End Sub
Demo: LotusScript Web Service Consumer




  Lets go build our LotusScript consumer LIVE…
LotusScript Consumer: Gotchas
  The entire LotusScript library is taken up with the computed Web
  service definition. Best not to make changes.
     Next time its refreshed, you will lose those changes!

  If you change the web service, you must remember to update the
  Web Services consumer.
     It doesn’t take long - so don’t forget it.
     And when you change the web service consumer script library, you must
     recompile all the LotusScript that relies on it.
         ‘Tools, Recompile LotusScript’ is your friend
LotusScript Consumer: Gotchas
  It requires the Notes 8 client to run on:
     We as Application Developers deploy solutions on users’ target notes clients
     Notes 8 may not yet be adopted in your environment
     This may help drive the upgrade process




  What if you need Web Service consumption now, and are not yet
  on Notes 8?
     The following sections will answer your questions…
Agenda
 Introduction
 Web Services Overview
 Using Domino to provide Web Services
    LotusScript in Domino v7 and v8
    Java using a servlet in Domino 5 upwards
    Using an agent
    REST

 Using Notes to consume Web Services
    LotusScript in Notes 8
    COM
    Stubby in Notes 7

 Summary, Q+A
Consuming a web service using COM
  There are applications which enable you to perform web service
  consumer work directly from LotusScript
     We shall focus on the MS Soap Toolkit
     Its not the only one - many others exist

  Very Quick and Very Dirty
     Its platform specific
     You need to install a DLL on each workstation

  When would you use this?
     Building test harnesses
     Perhaps on low user-count web service applications
COM Consumer
 So what does the code look like?


  Dim Client As Variant
  Set Client = CreateObject("MSSOAP.SoapClient")

  'Initialize connection to the Web Service
  Call Client.mssoapinit ( url )

  Dim result As String

  result = Client.getApplicationName()

  Msgbox "Application Name is: " + result
COM Consumer
 The MS Soap web service consumer:
    Is Platform specific - windows only
    Requires installation
    Is no longer supported
    Doesn’t handle complex objects well
        Arrays and Class Objects are returned as COM objects
        Very opaque - difficult to work out how they work
    Doesn’t sound very useful
        But it can help quickly build test harnesses

 A more useful COM based SOAP consumer:
    Microsoft XML HTTP object…
COM Consumer: MS XMLHTTP
 Its far more low level than MS SOAP
    You have to construct the HTTP header, SOAP payload
    You get back raw text, which you can pass to an XML parser

 Its bundled by default with various Microsoft Packages
    You might find that its already deployed in your environment
    Various versions exist


 Lets see it in action
Agenda
 Introduction
 Web Services Overview
 Using Domino to provide Web Services
    LotusScript in Domino v7 and v8
    Java using a servlet in Domino 5 upwards
    Using an agent
    REST

 Using Notes to consume Web Services
    LotusScript in Notes 8
    COM
    Stubby in Notes 7

 Summary, Q+A
Stubby: Introduction
  It:
        Is a project on http://OpenNtf.org
        Generates the relevant java stub files to allow you to consume java web services
        runs on the notes client
        Only runs on Notes 7
            So it’s a very tactical solution…

  Use the helper form to create the necessary stub files:
Stubby: Generating Stub Files
  Enter the URL for the web service and click ‘Generate Stub Files’
Stubby: Copy generated files
  Save the JAR file
  to your local hard
  drive
  Copy the same code to the clipboard




  Go to your database, create a new java agent
     Edit Project, and attach the JAR file
     Paste the sample code into the Java agent
     Extend the class to use the web service methods
Stubby: Exposing Java to LotusScript
  So far this has created a platform independent Java agent.
     But we’re interested in LotusScript!

  We have two easy ways of interfacing Java and LotusScript agents
     LS2J
     Notes agents can call Notes agents…
Stubby: LotusScript to Java Interface
  We can write a LotusScript agent
     Write a document with some parameter information
     Call a Java agent, and pass the NoteID of the document
     In the Java agent
         Read the parameters
         Write the results
         Save the Document
     Back in the LotusScript agent, re-open the same NoteID
         Read the results
Stubby: Calling from LotusScript




  Demo: Lets call a stubby web service from LotusScript.
Agenda
 Introduction
 Web Services Overview
 Using Domino to provide Web Services
    LotusScript in Domino v7 and v8
    Java using a servlet in Domino 5 upwards
    Using an agent
    REST

 Using Notes to consume Web Services
    LotusScript in Notes 8
    COM
    Stubby in Notes 7

 Summary, Q+A
Summary
 Web Services
    Are pretty straightforward
    An important part of your armoury
    Help break down barriers between Domino and other systems
    Help prevent data duplication in your environment


 By now, you know enough to make a real difference



 Keep learning.
Questions and Answers ?


  Please fill out your evaluations:
      They are taken extremely seriously, and form the basis for next years speaker list..

  Thank you for your time today




  Bill Buchan
      http://www.billbuchan.com
      http://www.hadsl.com
Legal Stuff
  The workshops and sessions offered have been prepared by IBM or the session speakers and reflect their own views. They are provided
  for general information purposes only, and are neither intended to, nor shall have the effect of being, legal or other guidance or advice to
  any participants. Such information is provided ‘as is’ without warranty of any kind, and IBM assumes no liability or responsibility for the
  content of any information made available during the workshops and sessions, including without limitation information you obtain during
  general or individual discussions and/or question and answer sessions.
  Material in this directory (including without limitation any advertisements) regarding third parties is based on information obtained from
  such parties and their Web sites. No effort has been made to independently verify the accuracy of the information. Mention or reference
  to all non-IBM products is for informational purposes only. Information is provided ‘as is’ without warranty of any kind. This document
  does not constitute an express or implied recommendation or endorsement by IBM of any third party, its product or service.
  This directory is provided AS IS without warranty of any kind, express or implied. IBM shall not be responsible for any damages arising
  out of the use of, or in any way related to, this directory and/or any information herein. Nothing herein shall create any warranties or
  representations from IBM or its licensors, or alter the terms and conditions of the applicable license or agreements governing the use of
  IBM software or services. References in these materials to IBM products, programs, or services do not imply that they will be available in
  all countries in which IBM operates. Product release dates and/or capabilities referenced in these materials may change at any time at
  IBM痴 sole discretion based on market opportunities or other factors, and are not intended to be a commitment to future product or feature
  availability. In addition, certain information may be based on IBM® current product plans and strategy which are subject to change by
  IBM without notice.
  Nothing contained in these materials is intended to, nor shall have the effect of, stating or implying that any activities undertaken by you
  will result in any specific sales, revenue growth or other results. All customer examples described are presented as illustrations of how
  those customers have used IBM products and the results they may have achieved. Actual environmental costs and performance
  characteristics may vary by customer.
  IBM, the IBM logo, the e-business logo, Lotus, Lotusphere, IBM Workplace, PartnerWorld, Move2Lotus, Notes, Domino, Sametime,
  QuickPlace, LearningSpace, iNotes, Domino Designer, Domino.Doc, Lotus Workflow, DB2, WebSphere, Tivoli, Rational, LotusScript,
  Everyplace, Lotus Enterprise Integrator, Lotus Discovery Server, Activity Explorer, MQIntegrator, eServer, zSeries, pSeries and iSeries
  are trademarks of IBM Corporation in the United States, other countries, or both. Java and all Java-based trademarks and logos are
  trademarks or registered trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.
  Microsoft, Windows, Windows NT, and the Windows logo are trademarks of Microsoft Corporation in the United States, other countries, or
  both. UNIX is a registered trademark of The Open Group in the United States and other countries. Other company, product or service
  names may be trademarks or service marks of others.

More Related Content

What's hot

Zusammenführung von HCL Nomad Web und Domino ohne SafeLinx - So gehts
Zusammenführung von HCL Nomad Web und Domino ohne SafeLinx - So gehtsZusammenführung von HCL Nomad Web und Domino ohne SafeLinx - So gehts
Zusammenführung von HCL Nomad Web und Domino ohne SafeLinx - So gehtspanagenda
 
Configuring Domino To Be An Ldap Directory And To Use An Ldap Directory
Configuring Domino To Be An Ldap Directory And To Use An Ldap DirectoryConfiguring Domino To Be An Ldap Directory And To Use An Ldap Directory
Configuring Domino To Be An Ldap Directory And To Use An Ldap DirectoryEdson Oliveira
 
HCL Domino V12 Key Security Features Overview
HCL Domino V12 Key Security Features Overview HCL Domino V12 Key Security Features Overview
HCL Domino V12 Key Security Features Overview hemantnaik
 
Best Practice TLS for IBM Domino
Best Practice TLS for IBM DominoBest Practice TLS for IBM Domino
Best Practice TLS for IBM DominoJared Roberts
 
HCL Sametime 12.0 – Converting from native Domino Directory to LDAP and Migra...
HCL Sametime 12.0 – Converting from native Domino Directory to LDAP and Migra...HCL Sametime 12.0 – Converting from native Domino Directory to LDAP and Migra...
HCL Sametime 12.0 – Converting from native Domino Directory to LDAP and Migra...Ales Lichtenberg
 
CollabSphere SC 103 : Domino on the Web : Yes, It's (Probably) Hackable
CollabSphere SC 103 : Domino on the Web : Yes, It's (Probably) HackableCollabSphere SC 103 : Domino on the Web : Yes, It's (Probably) Hackable
CollabSphere SC 103 : Domino on the Web : Yes, It's (Probably) HackableDarren Duke
 
Oracle WebLogic Server Basic Concepts
Oracle WebLogic Server Basic ConceptsOracle WebLogic Server Basic Concepts
Oracle WebLogic Server Basic ConceptsJames Bayer
 
Understanding domino memory 2017
Understanding domino memory 2017Understanding domino memory 2017
Understanding domino memory 2017mJOBrr
 
HCL Sametime V11 installation - tips
HCL Sametime V11 installation - tipsHCL Sametime V11 installation - tips
HCL Sametime V11 installation - tipsAles Lichtenberg
 
IBM Notes Traveler Best Practices
IBM Notes Traveler Best PracticesIBM Notes Traveler Best Practices
IBM Notes Traveler Best Practicesjayeshpar2006
 
April, 2021 OpenNTF Webinar - Domino Administration Best Practices
April, 2021 OpenNTF Webinar - Domino Administration Best PracticesApril, 2021 OpenNTF Webinar - Domino Administration Best Practices
April, 2021 OpenNTF Webinar - Domino Administration Best PracticesHoward Greenberg
 
Alles, was Sie ueber HCL Notes 64-Bit Clients wissen muessen
Alles, was Sie ueber HCL Notes 64-Bit Clients wissen muessenAlles, was Sie ueber HCL Notes 64-Bit Clients wissen muessen
Alles, was Sie ueber HCL Notes 64-Bit Clients wissen muessenpanagenda
 
Building Bizweb Microservices with Docker
Building Bizweb Microservices with DockerBuilding Bizweb Microservices with Docker
Building Bizweb Microservices with DockerKhôi Nguyễn Minh
 
Kafka Connect - debezium
Kafka Connect - debeziumKafka Connect - debezium
Kafka Connect - debeziumKasun Don
 
RNUG - Dirty Secrets of the Notes Client
RNUG - Dirty Secrets of the Notes ClientRNUG - Dirty Secrets of the Notes Client
RNUG - Dirty Secrets of the Notes ClientChristoph Adler
 
From A to Z-itrix: Setting up the most stable and fastest HCL Notes client on...
From A to Z-itrix: Setting up the most stable and fastest HCL Notes client on...From A to Z-itrix: Setting up the most stable and fastest HCL Notes client on...
From A to Z-itrix: Setting up the most stable and fastest HCL Notes client on...panagenda
 
Domino policies deep dive
Domino policies deep diveDomino policies deep dive
Domino policies deep diveMartijn de Jong
 

What's hot (20)

Zusammenführung von HCL Nomad Web und Domino ohne SafeLinx - So gehts
Zusammenführung von HCL Nomad Web und Domino ohne SafeLinx - So gehtsZusammenführung von HCL Nomad Web und Domino ohne SafeLinx - So gehts
Zusammenführung von HCL Nomad Web und Domino ohne SafeLinx - So gehts
 
Configuring Domino To Be An Ldap Directory And To Use An Ldap Directory
Configuring Domino To Be An Ldap Directory And To Use An Ldap DirectoryConfiguring Domino To Be An Ldap Directory And To Use An Ldap Directory
Configuring Domino To Be An Ldap Directory And To Use An Ldap Directory
 
HCL Domino V12 Key Security Features Overview
HCL Domino V12 Key Security Features Overview HCL Domino V12 Key Security Features Overview
HCL Domino V12 Key Security Features Overview
 
Best Practice TLS for IBM Domino
Best Practice TLS for IBM DominoBest Practice TLS for IBM Domino
Best Practice TLS for IBM Domino
 
HCL Sametime 12.0 – Converting from native Domino Directory to LDAP and Migra...
HCL Sametime 12.0 – Converting from native Domino Directory to LDAP and Migra...HCL Sametime 12.0 – Converting from native Domino Directory to LDAP and Migra...
HCL Sametime 12.0 – Converting from native Domino Directory to LDAP and Migra...
 
CollabSphere SC 103 : Domino on the Web : Yes, It's (Probably) Hackable
CollabSphere SC 103 : Domino on the Web : Yes, It's (Probably) HackableCollabSphere SC 103 : Domino on the Web : Yes, It's (Probably) Hackable
CollabSphere SC 103 : Domino on the Web : Yes, It's (Probably) Hackable
 
Oracle WebLogic Server Basic Concepts
Oracle WebLogic Server Basic ConceptsOracle WebLogic Server Basic Concepts
Oracle WebLogic Server Basic Concepts
 
Domino Adminblast
Domino AdminblastDomino Adminblast
Domino Adminblast
 
Understanding domino memory 2017
Understanding domino memory 2017Understanding domino memory 2017
Understanding domino memory 2017
 
HCL Sametime V11 installation - tips
HCL Sametime V11 installation - tipsHCL Sametime V11 installation - tips
HCL Sametime V11 installation - tips
 
60 Admin Tips
60 Admin Tips60 Admin Tips
60 Admin Tips
 
IBM Notes Traveler Best Practices
IBM Notes Traveler Best PracticesIBM Notes Traveler Best Practices
IBM Notes Traveler Best Practices
 
April, 2021 OpenNTF Webinar - Domino Administration Best Practices
April, 2021 OpenNTF Webinar - Domino Administration Best PracticesApril, 2021 OpenNTF Webinar - Domino Administration Best Practices
April, 2021 OpenNTF Webinar - Domino Administration Best Practices
 
Introduction to microservices
Introduction to microservicesIntroduction to microservices
Introduction to microservices
 
Alles, was Sie ueber HCL Notes 64-Bit Clients wissen muessen
Alles, was Sie ueber HCL Notes 64-Bit Clients wissen muessenAlles, was Sie ueber HCL Notes 64-Bit Clients wissen muessen
Alles, was Sie ueber HCL Notes 64-Bit Clients wissen muessen
 
Building Bizweb Microservices with Docker
Building Bizweb Microservices with DockerBuilding Bizweb Microservices with Docker
Building Bizweb Microservices with Docker
 
Kafka Connect - debezium
Kafka Connect - debeziumKafka Connect - debezium
Kafka Connect - debezium
 
RNUG - Dirty Secrets of the Notes Client
RNUG - Dirty Secrets of the Notes ClientRNUG - Dirty Secrets of the Notes Client
RNUG - Dirty Secrets of the Notes Client
 
From A to Z-itrix: Setting up the most stable and fastest HCL Notes client on...
From A to Z-itrix: Setting up the most stable and fastest HCL Notes client on...From A to Z-itrix: Setting up the most stable and fastest HCL Notes client on...
From A to Z-itrix: Setting up the most stable and fastest HCL Notes client on...
 
Domino policies deep dive
Domino policies deep diveDomino policies deep dive
Domino policies deep dive
 

Similar to jmp206 - Lotus Domino Web Services Jumpstart

iLug 2008 Web Services
iLug 2008 Web ServicesiLug 2008 Web Services
iLug 2008 Web ServicesBill Buchan
 
Jmp206 Web Services Bootcamp Final Draft
Jmp206   Web Services Bootcamp Final DraftJmp206   Web Services Bootcamp Final Draft
Jmp206 Web Services Bootcamp Final DraftBill Buchan
 
Softsphere 08 web services bootcamp
Softsphere 08 web services bootcampSoftsphere 08 web services bootcamp
Softsphere 08 web services bootcampBill Buchan
 
Admin2012 buchan web_services-v101
Admin2012 buchan web_services-v101Admin2012 buchan web_services-v101
Admin2012 buchan web_services-v101Bill Buchan
 
Nllug 2010 - Web-services bootcamp
Nllug 2010 - Web-services bootcampNllug 2010 - Web-services bootcamp
Nllug 2010 - Web-services bootcampBill Buchan
 
Nllug 2010-web-services
Nllug 2010-web-servicesNllug 2010-web-services
Nllug 2010-web-servicesBill Buchan
 
WebSocket Push Fallback - Transcript.pdf
WebSocket Push Fallback - Transcript.pdfWebSocket Push Fallback - Transcript.pdf
WebSocket Push Fallback - Transcript.pdfShaiAlmog1
 
Web services Concepts
Web services ConceptsWeb services Concepts
Web services Conceptspasam suresh
 
Learn Advanced JAVA at ASIT
Learn Advanced JAVA at ASITLearn Advanced JAVA at ASIT
Learn Advanced JAVA at ASITASIT
 
Data As A Service Composition Of Daas And Negotiation...
Data As A Service Composition Of Daas And Negotiation...Data As A Service Composition Of Daas And Negotiation...
Data As A Service Composition Of Daas And Negotiation...Christina Berger
 
servlet 2.5 & JSP 2.0
servlet 2.5 & JSP 2.0servlet 2.5 & JSP 2.0
servlet 2.5 & JSP 2.0megrhi haikel
 
REST+JS - Codebits 2011
REST+JS - Codebits 2011REST+JS - Codebits 2011
REST+JS - Codebits 2011João Nelas
 
Synchronous Reads Asynchronous Writes RubyConf 2009
Synchronous Reads Asynchronous Writes RubyConf 2009Synchronous Reads Asynchronous Writes RubyConf 2009
Synchronous Reads Asynchronous Writes RubyConf 2009pauldix
 
IBM Innovate 2013: Making Rational HATS a Strategic Investment
IBM Innovate 2013: Making Rational HATS a Strategic InvestmentIBM Innovate 2013: Making Rational HATS a Strategic Investment
IBM Innovate 2013: Making Rational HATS a Strategic InvestmentStrongback Consulting
 
Meteor Workshop - Open Sanca
Meteor Workshop - Open SancaMeteor Workshop - Open Sanca
Meteor Workshop - Open SancaPaulo Hecht
 
How do I - Networking and Webservices - Transcript.pdf
How do I - Networking and Webservices - Transcript.pdfHow do I - Networking and Webservices - Transcript.pdf
How do I - Networking and Webservices - Transcript.pdfShaiAlmog1
 

Similar to jmp206 - Lotus Domino Web Services Jumpstart (20)

iLug 2008 Web Services
iLug 2008 Web ServicesiLug 2008 Web Services
iLug 2008 Web Services
 
Jmp206 Web Services Bootcamp Final Draft
Jmp206   Web Services Bootcamp Final DraftJmp206   Web Services Bootcamp Final Draft
Jmp206 Web Services Bootcamp Final Draft
 
Softsphere 08 web services bootcamp
Softsphere 08 web services bootcampSoftsphere 08 web services bootcamp
Softsphere 08 web services bootcamp
 
Admin2012 buchan web_services-v101
Admin2012 buchan web_services-v101Admin2012 buchan web_services-v101
Admin2012 buchan web_services-v101
 
Nllug 2010 - Web-services bootcamp
Nllug 2010 - Web-services bootcampNllug 2010 - Web-services bootcamp
Nllug 2010 - Web-services bootcamp
 
Nllug 2010-web-services
Nllug 2010-web-servicesNllug 2010-web-services
Nllug 2010-web-services
 
WebSocket Push Fallback - Transcript.pdf
WebSocket Push Fallback - Transcript.pdfWebSocket Push Fallback - Transcript.pdf
WebSocket Push Fallback - Transcript.pdf
 
Webservices
WebservicesWebservices
Webservices
 
Web services Concepts
Web services ConceptsWeb services Concepts
Web services Concepts
 
Web Programming
Web ProgrammingWeb Programming
Web Programming
 
Learn Advanced JAVA at ASIT
Learn Advanced JAVA at ASITLearn Advanced JAVA at ASIT
Learn Advanced JAVA at ASIT
 
Data As A Service Composition Of Daas And Negotiation...
Data As A Service Composition Of Daas And Negotiation...Data As A Service Composition Of Daas And Negotiation...
Data As A Service Composition Of Daas And Negotiation...
 
Cloud Computing basic
Cloud Computing basicCloud Computing basic
Cloud Computing basic
 
servlet 2.5 & JSP 2.0
servlet 2.5 & JSP 2.0servlet 2.5 & JSP 2.0
servlet 2.5 & JSP 2.0
 
Web services
Web servicesWeb services
Web services
 
REST+JS - Codebits 2011
REST+JS - Codebits 2011REST+JS - Codebits 2011
REST+JS - Codebits 2011
 
Synchronous Reads Asynchronous Writes RubyConf 2009
Synchronous Reads Asynchronous Writes RubyConf 2009Synchronous Reads Asynchronous Writes RubyConf 2009
Synchronous Reads Asynchronous Writes RubyConf 2009
 
IBM Innovate 2013: Making Rational HATS a Strategic Investment
IBM Innovate 2013: Making Rational HATS a Strategic InvestmentIBM Innovate 2013: Making Rational HATS a Strategic Investment
IBM Innovate 2013: Making Rational HATS a Strategic Investment
 
Meteor Workshop - Open Sanca
Meteor Workshop - Open SancaMeteor Workshop - Open Sanca
Meteor Workshop - Open Sanca
 
How do I - Networking and Webservices - Transcript.pdf
How do I - Networking and Webservices - Transcript.pdfHow do I - Networking and Webservices - Transcript.pdf
How do I - Networking and Webservices - Transcript.pdf
 

More from Bill Buchan

Dummies guide to WISPS
Dummies guide to WISPSDummies guide to WISPS
Dummies guide to WISPSBill Buchan
 
WISP for Dummies
WISP for DummiesWISP for Dummies
WISP for DummiesBill Buchan
 
WISP Worst Practices
WISP Worst PracticesWISP Worst Practices
WISP Worst PracticesBill Buchan
 
Marykirk raft race presentation night 2014
Marykirk raft race presentation night 2014Marykirk raft race presentation night 2014
Marykirk raft race presentation night 2014Bill Buchan
 
Dev buchan best practices
Dev buchan best practicesDev buchan best practices
Dev buchan best practicesBill Buchan
 
Dev buchan leveraging
Dev buchan leveragingDev buchan leveraging
Dev buchan leveragingBill Buchan
 
Dev buchan leveraging the notes c api
Dev buchan leveraging the notes c apiDev buchan leveraging the notes c api
Dev buchan leveraging the notes c apiBill Buchan
 
Dev buchan everything you need to know about agent design
Dev buchan everything you need to know about agent designDev buchan everything you need to know about agent design
Dev buchan everything you need to know about agent designBill Buchan
 
Dev buchan 30 proven tips
Dev buchan 30 proven tipsDev buchan 30 proven tips
Dev buchan 30 proven tipsBill Buchan
 
Entwicker camp2007 calling-the-c-api-from-lotusscript
Entwicker camp2007 calling-the-c-api-from-lotusscriptEntwicker camp2007 calling-the-c-api-from-lotusscript
Entwicker camp2007 calling-the-c-api-from-lotusscriptBill Buchan
 
Entwicker camp2007 blackberry-workshop
Entwicker camp2007 blackberry-workshopEntwicker camp2007 blackberry-workshop
Entwicker camp2007 blackberry-workshopBill Buchan
 
Reporting on your domino environment v1
Reporting on your domino environment v1Reporting on your domino environment v1
Reporting on your domino environment v1Bill Buchan
 
12 Step Guide to Lotuscript
12 Step Guide to Lotuscript12 Step Guide to Lotuscript
12 Step Guide to LotuscriptBill Buchan
 
Everything you ever wanted to know about lotus script
Everything you ever wanted to know about lotus scriptEverything you ever wanted to know about lotus script
Everything you ever wanted to know about lotus scriptBill Buchan
 
Admin camp 2011-domino-sso-with-ad
Admin camp 2011-domino-sso-with-adAdmin camp 2011-domino-sso-with-ad
Admin camp 2011-domino-sso-with-adBill Buchan
 
Connections Lotusphere Worst Practices 2013
Connections Lotusphere Worst Practices 2013Connections Lotusphere Worst Practices 2013
Connections Lotusphere Worst Practices 2013Bill Buchan
 
Lotusphere 2009 The 11 Commandments
Lotusphere 2009 The 11 CommandmentsLotusphere 2009 The 11 Commandments
Lotusphere 2009 The 11 CommandmentsBill Buchan
 

More from Bill Buchan (20)

Dummies guide to WISPS
Dummies guide to WISPSDummies guide to WISPS
Dummies guide to WISPS
 
WISP for Dummies
WISP for DummiesWISP for Dummies
WISP for Dummies
 
WISP Worst Practices
WISP Worst PracticesWISP Worst Practices
WISP Worst Practices
 
Marykirk raft race presentation night 2014
Marykirk raft race presentation night 2014Marykirk raft race presentation night 2014
Marykirk raft race presentation night 2014
 
Dev buchan best practices
Dev buchan best practicesDev buchan best practices
Dev buchan best practices
 
Dev buchan leveraging
Dev buchan leveragingDev buchan leveraging
Dev buchan leveraging
 
Dev buchan leveraging the notes c api
Dev buchan leveraging the notes c apiDev buchan leveraging the notes c api
Dev buchan leveraging the notes c api
 
Dev buchan everything you need to know about agent design
Dev buchan everything you need to know about agent designDev buchan everything you need to know about agent design
Dev buchan everything you need to know about agent design
 
Dev buchan 30 proven tips
Dev buchan 30 proven tipsDev buchan 30 proven tips
Dev buchan 30 proven tips
 
Entwicker camp2007 calling-the-c-api-from-lotusscript
Entwicker camp2007 calling-the-c-api-from-lotusscriptEntwicker camp2007 calling-the-c-api-from-lotusscript
Entwicker camp2007 calling-the-c-api-from-lotusscript
 
Entwicker camp2007 blackberry-workshop
Entwicker camp2007 blackberry-workshopEntwicker camp2007 blackberry-workshop
Entwicker camp2007 blackberry-workshop
 
Bp301
Bp301Bp301
Bp301
 
Ad507
Ad507Ad507
Ad507
 
Ad505 dev blast
Ad505 dev blastAd505 dev blast
Ad505 dev blast
 
Reporting on your domino environment v1
Reporting on your domino environment v1Reporting on your domino environment v1
Reporting on your domino environment v1
 
12 Step Guide to Lotuscript
12 Step Guide to Lotuscript12 Step Guide to Lotuscript
12 Step Guide to Lotuscript
 
Everything you ever wanted to know about lotus script
Everything you ever wanted to know about lotus scriptEverything you ever wanted to know about lotus script
Everything you ever wanted to know about lotus script
 
Admin camp 2011-domino-sso-with-ad
Admin camp 2011-domino-sso-with-adAdmin camp 2011-domino-sso-with-ad
Admin camp 2011-domino-sso-with-ad
 
Connections Lotusphere Worst Practices 2013
Connections Lotusphere Worst Practices 2013Connections Lotusphere Worst Practices 2013
Connections Lotusphere Worst Practices 2013
 
Lotusphere 2009 The 11 Commandments
Lotusphere 2009 The 11 CommandmentsLotusphere 2009 The 11 Commandments
Lotusphere 2009 The 11 Commandments
 

jmp206 - Lotus Domino Web Services Jumpstart

  • 1. Web Services Bootcamp Bill Buchan - HADSL ®
  • 2. Agenda Introduction Web Services Overview Using Domino to provide Web Services LotusScript in Domino v7 and v8 Java using a servlet in Domino 5 upwards Using an agent REST Using Notes to consume Web Services LotusScript in Notes 8 COM Stubby in Notes 7 Summary, Q+A
  • 3. Introduction I am Bill Buchan. I am: A blogger - http://www.billbuchan.com I was blogging when it was called ‘Talking rubbish on the internet’. Some things never change. A principal of HADSL - http://www.hadsl.com A Notes veteran of some 14 years Old. Its my birthday today, so no loud noises... You are Lotus Domino developers Interested in starting or enhancing Web Services in your environment Familiar with LotusScript, and perhaps Java
  • 4. This is a JumpStart This takes you from a low level in a subject to a good level of expertise Little existing knowledge is assumed But we assume your are developers, and are familiar with LotusScript Its 2 hours long So get comfortable, visit the toilet People have paid to come to this session So as a matter of courtesy, please switch off all mobile phones, etc If your phone goes off, you will have to buy a drink for everyone in the room! Feel free to ask some questions as we go along But I reserve the right to leave some answers till the end I will be doing live demonstrations So feel free to laugh if they break!
  • 5. Agenda Introduction Web Services Overview Using Domino to provide Web Services LotusScript in Domino v7 and v8 Java using a servlet in Domino 5 upwards Using an agent REST Using Notes to consume Web Services LotusScript in Notes 8 COM Stubby in Notes 7 Summary, Q+A
  • 6. A quick Web Services overview Web services are: A standard application to application protocol for exchanging structured data Usually (but not always) using the http protocol Usually (but not always) using XML Usually we provide meta-information on what our service will do, using a language called WSDL (Web Service Description Language) – formatted in XML. Web services are: Language independent Platform independent Data format representation independent But hopefully you all knew this already...
  • 7. Web Services Architecture The players: The Web Service server Can answer questions on what it can do Can accept requests from Web Service clients Can respond to requests from Web service clients The Web Service client (or consumer)‫‏‬ Knows where the web service server is located Knows the services that it requires Knows how to prepare a Web Services Query Knows how to interpret the returned data
  • 8. Web Services Protocol A typical web service session looks like: Client to Web Service Server “Tell me the answer to this question” Web Service Server “Here it is” Conclusion: The clients drive the conversation The Server cannot initiate a conversation with the client.
  • 9. Web Services Protocol (in more detail)‫‏‬ The Web Services Protocol: The client decides it needs to ask the server for some information It constructs the relevant XML based web services query (either dynamically or in a static fashion depending on the complexity of the application)‫‏‬ It then connects to the Web Service Server Pushing the web request up as an HTTP 'Post' request It waits for a response The Web service server then 'Posts' back an XML payload representing the answer The client then unpacks and interprets the data.
  • 10. This sounds hard... Not really. Its a combination of web protocol and XML construction and unpacking Most of the hard work is done for you by the various Web Service servers and Consumers Its fairly easy to debug using the correct tools
  • 11. Lets prepare a sample application Fairly simple Domino Contact Database A single ‘Contact’ form with some information Not meant to be a ‘real-world’ example Its here to demonstrate the techniques All example code is in the database Simple to figure out and ‘research’ Probably isnt best practice!
  • 14. How do we test a web service? I recommend SoapUI Its free! http://www.soapui.org It allows you to interrogate a web service And build test case with real data
  • 16. Agenda Introduction Web Services Overview Using Domino to provide Web Services LotusScript in Domino v7 and v8 Java using a servlet in Domino 5 upwards Using an agent REST Using Notes to consume Web Services LotusScript in Notes 8 COM Stubby in Notes 7 Summary, Q+A
  • 17. Domino as a Web Service Server Three different methods: Using LotusScript as a Web service Coding a Java Servlet Using an agent By far the simplest is to use a LotusScript Web Service The majority of the work is done for you! Servlets should be avoided unless You are running on Domino v6.5.x or older You absolutely require persistence Agents are good for Very low transaction services Simple services
  • 18. Agenda Introduction Web Services Overview Using Domino to provide Web Services LotusScript in Domino v7 and v8 Java using a servlet in Domino 5 upwards Using an agent REST Using Notes to consume Web Services LotusScript in Notes 8 COM Stubby in Notes 7 Summary, Q+A
  • 19. LotusScript Web Services in nd7 and nd8 Introduced in Lotus Domino 7 Robust Code the web service using LotusScript Fairly high performance but Remember: Lack of persistence between calls, so Be aware of what your code is doing! Use ‘Agent Profiling’ to see timings…
  • 20. Profiling a LotusScript Web Service LotusScript web services are very similar to LotusScript agents So you can profile them. Enable Profiling on the Web Services Properties tab View the last run profile: Right click on the Web Service View Profile Results
  • 21. A Sample Profile This shows how long the agent took to run, and how long the agent spent inside the Notes Object Interface In our case, 761ms total, and 0ms within NOI One call to CurrentDatabase, and one call to Title. Obviously, this wasn’t a very interesting web service call…
  • 22. Designing a Web Service Spend time thinking about how your consumer will use this web service. More time thinking, less time coding You do NOT want to change this web service interface once its published Instead - roll out a new web service Think through client use cases Remember - you can use LotusScript to perform complex business rules, and provide a summary of data to your consumer Don’t assume the consumer can perform a lot of data manipulation – BlackBerry smartphones / Windows Mobile ? Best to put complex code in a script library, and just surface it via a web service It means you can put a normal agent ‘test harness’ around it and debug it Remote Debugging might not work…
  • 23. Contacts.nsf - Web Service In our case we wish to: Be able to list all users By Name By Department Be able to get details on a particular user Be able to search for users Do we Pass all fields back as web service items? Pass back an array of fields? In this case, we pass back Web Service Items Assume data mapping knowledge and responsibility.
  • 24. Contacts.nsf - Web Service Design We design our web service interface within a ‘Class’ in LotusScript. At this point, you probably wished that you studied the Object Orientated LotusScript sessions I used to give… Good example presentations on my personal blog presentations page http://www.billbuchan.com/web.nsf/plinks/BBUN6MQECQ.htm Our web service will expose all ‘public’ methods and properties We do not have to put all the code in one ‘class’ Beware of extending existing classes - you might expose more than you want! Beware over-exposure…
  • 25. Contacts.nsf - Web Service Design LotusScript does NOT allow functions to return Arrays. This is a language limitation, not a Web Service Limitation It can return simple types A variant (but since web services don’t support ‘em, we cant use ‘em) Instances of other classes… We need to use arrays to return results For instance, we need to return an array of Zero or more entries to list our users. How do we do that? We can define a class and return an instance of that class…
  • 26. Web Service Design - returning complex types We can define a class called Class returnArray ‘ReturnArray’ which has a single Public S() As array as a public member. String The constructor initialises the Sub new array so that it has one blank entry. Redim S(0) We can then populate this array S(0) = "" with one or more entries. End Sub End Class LotusScript Web services only supports single dimension arrays. Nd7 supports arrays with one element or more - nd8 supports ‘empty’ arrays.
  • 27. Web Services Design - returning complex types… We shall return our Person Class Person contact record using a class. Public FirstName As String We DON’T have a constructor Public MiddleInitials As String All elements are Public - so it’ll be Public LastName As String exposed to the Web Service as Public FullName As String data. Our property names will be used Public Telephone As String by the web service as field names Public Cellphone As String Since LotusScript is case Public eMail As String insensitive, the web service Public HomePhone As String field names will be UPPERCASE. Public Department as String Public Notes As String End Class
  • 28. Demo Time! Finally! A Demo!
  • 29. Web Services Design - lets make it better We need to add: Logging. We need to know when it works, and importantly, when it does not Error Handling. We need to pass errors back to the consumer Security. We might want to harden this service somewhat We committed the following sins: We put all the code in the web service itself, making it hard to test. Best to consider embedding most of the code in script libraries We’ve tightly bound the data structures in our data to our web service If we add more fields to our contact record - we shall have to change the web service. And therefore, all our clients will have to be checked and/or recompiled. If the data set is likely to change, construct a more flexible data-mapping schema
  • 30. ND7 and ND8 differences Web services built or compiled in Notes 8 Designer WONT run on ND7 anymore! So be careful about what web services you host on which servers, and which version of designer you use. Just bear this version difference in the same manner as all other version differences.
  • 31. ND7 and ND8 differences In ND7, the class used for the web service has to reside in the web service design element. In ND8, this can be in a script library. This means that for complex services, you can place all the business code in a script library, allowing simple construction of a test harness. ND8 now supports code in Java Libraries ND8 supports more error handling SOAP elements ND8 supports ‘empty’ arrays - nd7 does not
  • 32. Testing this web service using SoapUI Demo: Lets go test this service with SoapUI
  • 33. Web Services Design - lets talk about WSDL WSDL - Web Services Description Language Its an XML document You can query a web service for its WSDL, You build a web service consumer from the WSDL Lotus Domino LotusScript Web Services WSDL Is automatically generated for you You can query a LotusScript Web Service by passing a URL: http://<host>/<directory>/<database>/<web service>?WSDL It will then return an XML document showing the WSDL
  • 34. WSDL: Example The first section outlines the data objects we shall pass from this service You can see our returnArray & Person objects Note that our variables default to Uppercase - this is a side-effect of LotusScript being a non-case sensitive language
  • 35. WSDL: Example The second section of our WSDL deals with the Web Services Messages that will be sent to the Web service, and the types that get returned.
  • 36. WSDL: Example The port section associates input messages - function calls - with their return types.
  • 37. WSDL: Example The binding section defines all input and output operations
  • 38. WSDL: Example The Service section Connects the service to the binding Gives a fully formed URL for the service
  • 39. WSDL Why mention that in such detail? LotusScript Web services does all the work. The following web service engines do NOT. And it seems like a lot of work…
  • 40. Agenda Introduction Web Services Overview Using Domino to provide Web Services LotusScript in Domino v7 and v8 Java using a servlet in Domino 5 upwards Using an agent REST Using Notes to consume Web Services LotusScript in Notes 8 COM Stubby in Notes 7 Summary, Q+A
  • 41. Java Servlet Web Service: Overview Why construct a Web Service in a Servlet? Persistence The LotusScript web engine does not persist data between calls. Complex operations can take advantage of persistent memory objects in Java Performance Because of persistence, you may be able to support many more simultaneous users What are the downsides? Very old servlet engine (Servlet v1.1) in Domino. Very little control. Old versions of Java Example. Nd6 uses Java 1.3.1, which is no longer supported Complex You have to do lots more work to achieve the same goals More difficult to support
  • 42. Java Servlet Web Service: Introduction So how do servlets work? Compiled Java code placed in Dominoservlet directory in server data directory Servlet Engine enabled on server document When http engine loads, it loads any defined servlets To reload a servlet, restart the http process Uses ‘servlet.properties’ file in data directory to Map servlet URLs to servlets Load servlets into memory I use eclipse to build the servlet You might be able to debug in real-time You can optionally link to the Notes/Domino Java interface to examine data
  • 43. Java Servlet Engine: servlet.properties file The text file ‘servlet.properties’ exists in the domino directory servlet.Contact.code=Contact # Supply the intitialisation arguments # Server = the name of this server # Db = the Database path for the web service database # Name = the alias name you've given the servlet # WSDL = the name of the WSDL file. # (remember to double up "" characters to "" !!!) # This should all be in one line… servlet.Contact.initArgs=Db=customers/ls2008/Contacts.nsf,Server=idm- demo1/HADSL,Name=Contact,WSDL=c:LotusDominoidm- demo1dominoservletContacts.wsdl # Load this servlet at startup servlets.startup=Contact
  • 44. Java Servlet: Architecture The Servlet will On startup, will read parameters from servlet.properties. Respond to http ‘get’ requests and return the WSDL for this service For convenience, we’ll store this in a file Respond to http ‘post’ requests Parse incoming SOAP for requests Return results as XML
  • 45. Java Servlet Engine: Code Lets walk through the code…
  • 46. Java Servlet Engine: Summary It’s a LOT of work Its fairly normal Java Its quite hard to change or add new functionality Remember: The Servlet engine in Domino is old, and fairly crude. You might wish to use a more modern Servlet engine such as Websphere.
  • 47. Agenda Introduction Web Services Overview Using Domino to provide Web Services LotusScript in Domino v7 and v8 Java using a servlet in Domino 5 upwards Using an agent REST Using Notes to consume Web Services LotusScript in Notes 8 COM Stubby in Notes 7 Summary, Q+A
  • 48. Agent based Web Service Engine Now that we understand how a web service works, we can construct an Agent based Web Service Pros Can run in Domino 6 Straightforward Cons Performance Complex code
  • 49. Agent Based Server - Architecture A single web-based agent Accepts requests GET Requests tend to be WSDL requests POST Requests are SOAP Requests We can use the NotesDOM parser to decode the incoming SOAP Fairly complex code We can just use “Print” statements to output the results Fairly ‘brittle’. Tightly bound to the Web Service
  • 50. Agent Based Server - Demo Demo: Lets see this in action
  • 51. Agent Based Server - Summary Lets look at the code Pros No additional server code required It can run on Domino 6. Cons The code is brittle, unpleasant Only do this if you have no other, better, web servers available
  • 52. Agenda Introduction Web Services Overview Using Domino to provide Web Services LotusScript in Domino v7 and v8 Java using a servlet in Domino 5 upwards Using an agent REST Using Notes to consume Web Services LotusScript in Notes 8 COM Stubby in Notes 7 Summary, Q+A
  • 53. REST REST - Representational State Transition Its an architectural proposal - not a standard In terms of Web Services it means The query part of the web service is represented using an URL. For Example: http://myserver.com/service/ListContacts http://myserver.com/service/ContactInfo/Fred+Flintstone http://myserver.com/service/ListContactsByDepartment/Sales Who does it help? With simple web services, you spend less time parsing XML Very simple to implement consumer code. No incoming XML payload.
  • 54. REST We pass in parameters on the URL. Our URL needs to start with http://dominserver/path/database.nsf/DesignElement…. Any URL customisation needs to happen after the DesignElement. EG: http://ibm.com/db.nsf/Agent?OpenAgent&Cmd=ListUsers http://ibm.com/db.nsf/Agent?OpenAgent &Cmd=GetUser&Name=Fred+Flintstone In our servlet, or in our Agent We can intercept the incoming URL, decode it, and take action.
  • 55. Agenda Introduction Web Services Overview Using Domino to provide Web Services LotusScript in Domino v7 and v8 Java using a servlet in Domino 5 upwards Using an agent REST Using Notes to consume Web Services LotusScript in Notes 8 COM Stubby in Notes 7 Summary, Q+A
  • 56. Consuming a web service - overview Why consume web services? To gain access to information in other systems To prevent the syncronisation and replication of external data sources to Notes Real time, up to date data lookup Where? We could use a scheduled Java agent in Domino to interrogate external services No UI means you have to monitor and check We could use client-driven code on the client workstation Be aware of network issues between the clients and the remote service – Large corporate intranets are rarely stable and predictable – Predict & accommodate remote service outage Any issues are immediately visible to the users – Empowering or Confusing?
  • 57. Consuming a web service - overview Security Remote web services may require Username/password login Encrypted username/password pairs in data SSL. Things change You may have to change your web service consumer to accommodate this The remote web service may move When designing, don’t hard-code…
  • 58. Consuming a web service - examples In the following sections, We shall use the web services we constructed earlier as a target We wont use any security features for simplicity We’re coding to demonstrate technique, not best practices So by all means reuse this code, but make it production-strength – Add Error handling – Remove hard-coding – Add Logging
  • 59. Agenda Introduction Web Services Overview Using Domino to provide Web Services LotusScript in Domino v7 and v8 Java using a servlet in Domino 5 upwards Using an agent REST Using Notes to consume Web Services LotusScript in Notes 8 COM Stubby in Notes 7 Summary, Q+A
  • 60. Consuming Web Services with LotusScript Summary: Notes 8 Its very simple It works in LotusScript and in Java It does a lot of work for you How do I construct a Web Service Consumer in LotusScript? Create a new, empty script library Click on the Import WSDL button It creates a Class definition You can then “use” the script library and class.
  • 61. Consuming Web Services using LotusScript Create a new LotusScript Script Library: Click on the WSDL button…
  • 62. Consuming Web Services with LotusScript It needs a WSDL file. What's that? You can open the WSDL definition for your web service in your browser Use View Source, and save that as a WSDL file. Select it… Designer will then construct Sub Initialize helper classes and a main Dim C As New Contacts class which we can then call Dim V As Variant Set V = C.listUsers() Forall thisUser In V.S Print "Found User: " + thisUser That’s it! End Forall End Sub
  • 63. Demo: LotusScript Web Service Consumer Lets go build our LotusScript consumer LIVE…
  • 64. LotusScript Consumer: Gotchas The entire LotusScript library is taken up with the computed Web service definition. Best not to make changes. Next time its refreshed, you will lose those changes! If you change the web service, you must remember to update the Web Services consumer. It doesn’t take long - so don’t forget it. And when you change the web service consumer script library, you must recompile all the LotusScript that relies on it. ‘Tools, Recompile LotusScript’ is your friend
  • 65. LotusScript Consumer: Gotchas It requires the Notes 8 client to run on: We as Application Developers deploy solutions on users’ target notes clients Notes 8 may not yet be adopted in your environment This may help drive the upgrade process What if you need Web Service consumption now, and are not yet on Notes 8? The following sections will answer your questions…
  • 66. Agenda Introduction Web Services Overview Using Domino to provide Web Services LotusScript in Domino v7 and v8 Java using a servlet in Domino 5 upwards Using an agent REST Using Notes to consume Web Services LotusScript in Notes 8 COM Stubby in Notes 7 Summary, Q+A
  • 67. Consuming a web service using COM There are applications which enable you to perform web service consumer work directly from LotusScript We shall focus on the MS Soap Toolkit Its not the only one - many others exist Very Quick and Very Dirty Its platform specific You need to install a DLL on each workstation When would you use this? Building test harnesses Perhaps on low user-count web service applications
  • 68. COM Consumer So what does the code look like? Dim Client As Variant Set Client = CreateObject("MSSOAP.SoapClient") 'Initialize connection to the Web Service Call Client.mssoapinit ( url ) Dim result As String result = Client.getApplicationName() Msgbox "Application Name is: " + result
  • 69. COM Consumer The MS Soap web service consumer: Is Platform specific - windows only Requires installation Is no longer supported Doesn’t handle complex objects well Arrays and Class Objects are returned as COM objects Very opaque - difficult to work out how they work Doesn’t sound very useful But it can help quickly build test harnesses A more useful COM based SOAP consumer: Microsoft XML HTTP object…
  • 70. COM Consumer: MS XMLHTTP Its far more low level than MS SOAP You have to construct the HTTP header, SOAP payload You get back raw text, which you can pass to an XML parser Its bundled by default with various Microsoft Packages You might find that its already deployed in your environment Various versions exist Lets see it in action
  • 71. Agenda Introduction Web Services Overview Using Domino to provide Web Services LotusScript in Domino v7 and v8 Java using a servlet in Domino 5 upwards Using an agent REST Using Notes to consume Web Services LotusScript in Notes 8 COM Stubby in Notes 7 Summary, Q+A
  • 72. Stubby: Introduction It: Is a project on http://OpenNtf.org Generates the relevant java stub files to allow you to consume java web services runs on the notes client Only runs on Notes 7 So it’s a very tactical solution… Use the helper form to create the necessary stub files:
  • 73. Stubby: Generating Stub Files Enter the URL for the web service and click ‘Generate Stub Files’
  • 74. Stubby: Copy generated files Save the JAR file to your local hard drive Copy the same code to the clipboard Go to your database, create a new java agent Edit Project, and attach the JAR file Paste the sample code into the Java agent Extend the class to use the web service methods
  • 75. Stubby: Exposing Java to LotusScript So far this has created a platform independent Java agent. But we’re interested in LotusScript! We have two easy ways of interfacing Java and LotusScript agents LS2J Notes agents can call Notes agents…
  • 76. Stubby: LotusScript to Java Interface We can write a LotusScript agent Write a document with some parameter information Call a Java agent, and pass the NoteID of the document In the Java agent Read the parameters Write the results Save the Document Back in the LotusScript agent, re-open the same NoteID Read the results
  • 77. Stubby: Calling from LotusScript Demo: Lets call a stubby web service from LotusScript.
  • 78. Agenda Introduction Web Services Overview Using Domino to provide Web Services LotusScript in Domino v7 and v8 Java using a servlet in Domino 5 upwards Using an agent REST Using Notes to consume Web Services LotusScript in Notes 8 COM Stubby in Notes 7 Summary, Q+A
  • 79. Summary Web Services Are pretty straightforward An important part of your armoury Help break down barriers between Domino and other systems Help prevent data duplication in your environment By now, you know enough to make a real difference Keep learning.
  • 80. Questions and Answers ? Please fill out your evaluations: They are taken extremely seriously, and form the basis for next years speaker list.. Thank you for your time today Bill Buchan http://www.billbuchan.com http://www.hadsl.com
  • 81. Legal Stuff The workshops and sessions offered have been prepared by IBM or the session speakers and reflect their own views. They are provided for general information purposes only, and are neither intended to, nor shall have the effect of being, legal or other guidance or advice to any participants. Such information is provided ‘as is’ without warranty of any kind, and IBM assumes no liability or responsibility for the content of any information made available during the workshops and sessions, including without limitation information you obtain during general or individual discussions and/or question and answer sessions. Material in this directory (including without limitation any advertisements) regarding third parties is based on information obtained from such parties and their Web sites. No effort has been made to independently verify the accuracy of the information. Mention or reference to all non-IBM products is for informational purposes only. Information is provided ‘as is’ without warranty of any kind. This document does not constitute an express or implied recommendation or endorsement by IBM of any third party, its product or service. This directory is provided AS IS without warranty of any kind, express or implied. IBM shall not be responsible for any damages arising out of the use of, or in any way related to, this directory and/or any information herein. Nothing herein shall create any warranties or representations from IBM or its licensors, or alter the terms and conditions of the applicable license or agreements governing the use of IBM software or services. References in these materials to IBM products, programs, or services do not imply that they will be available in all countries in which IBM operates. Product release dates and/or capabilities referenced in these materials may change at any time at IBM痴 sole discretion based on market opportunities or other factors, and are not intended to be a commitment to future product or feature availability. In addition, certain information may be based on IBM® current product plans and strategy which are subject to change by IBM without notice. Nothing contained in these materials is intended to, nor shall have the effect of, stating or implying that any activities undertaken by you will result in any specific sales, revenue growth or other results. All customer examples described are presented as illustrations of how those customers have used IBM products and the results they may have achieved. Actual environmental costs and performance characteristics may vary by customer. IBM, the IBM logo, the e-business logo, Lotus, Lotusphere, IBM Workplace, PartnerWorld, Move2Lotus, Notes, Domino, Sametime, QuickPlace, LearningSpace, iNotes, Domino Designer, Domino.Doc, Lotus Workflow, DB2, WebSphere, Tivoli, Rational, LotusScript, Everyplace, Lotus Enterprise Integrator, Lotus Discovery Server, Activity Explorer, MQIntegrator, eServer, zSeries, pSeries and iSeries are trademarks of IBM Corporation in the United States, other countries, or both. Java and all Java-based trademarks and logos are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States, other countries, or both. Microsoft, Windows, Windows NT, and the Windows logo are trademarks of Microsoft Corporation in the United States, other countries, or both. UNIX is a registered trademark of The Open Group in the United States and other countries. Other company, product or service names may be trademarks or service marks of others.