Skip to main content link. Accesskey S
  • Log In
  • Help
  • IBM Logo
  • Lotus Expeditor wiki
  • All Wikis
  • All Forums
  • Home
  • Product Documentation
  • Community Articles
  • Learning Center
  • IBM Redbooks
  • API Documentation
Community Articles Product Documentation Learning Center IBM Redbooks API Documentation This category Lotus Expeditor 6.2.3 Documentation Custom Search Scope...
Search
Community Articles > Expeditor Client for Desktop > Sample: Using Accounts with Web Services
  • New Article
  • Share Show Menu▼
  • Subscribe Show Menu▼

About the Original Author

IBM contributorVan Staub
Contribution Summary:
  • Articles authored: 26
  • Articles edited: 13
  • Comments Posted: 4

Recent articles by this author

Sample: Toolbar and Menu Contributions

Expeditor user interface team best practices on toolbar and menu contributions

Sample: Component Properties

OverviewComponent properties allow developers to create code that at compile time has specific function but accepts flexible input at runtime. For example, a developer can create a component that uses a predefined component property to update the title tab's text within a composite ...

Sample: Multiuser Features

Overview When multiple users share the same workstation, the configuration is referred to as a multiuser installation. This means that a single Expeditor client exists and is shared among all users; however, each user has their own workspace containing configuration details specific to that ...

Sample: Starting Plugins

Overview By default, Eclipse plugins are lazy. Lazy is the technical term (located in the bundle's manifest) that means that plugins are started when a request is either directly made by the Platform to start the plugin or indirectly through class loading. For example, the latter case implies ...

Sample: HTTP Communication

Overview The enhanced HTTP client in Expeditor allows developers to quickly create code that requests data from remote servers over HTTP or HTTPS. The enhanced client wraps the standard Java URLConnectionclasses such that authenticated requests leverage the Accounts framework and HTTPS ...
Community articleSample: Using Accounts with Web Services
Added by Van Staub | Edited by IBM contributor Van Staub on September 14, 2010 | Version 3
expanded Abstract
collapsed Abstract
The accounts framework provides name, password credentials to various back-end servers. If required, Axis web services can be used in conjunction with the accounts framework to provide WS security data to the application server.
Tags: accounts, samples, web services
ShowTable of Contents
HideTable of Contents
  • 1 Overview
  • 2 Web Service
  • 3 Creating the Axis Web Service Client
  • 4 Assigning the Account
  • 5 Using the Account
  • 6 Sample Details
    • 6.1 remoteEAR.ear
    • 6.2 com.ibm.rcp.support.ws.remote.client.axis
    • 6.3 com.ibm.rcp.support.axis.utll
  • 7 Running the Sample

Overview


The accounts framework provides name, password credentials to various back-end servers. If required, Axis web services can be used in conjunction with the accounts framework to provide WS security data to the application server.

Web Service


The details of the web service are covered in another sampleexternal link. The web service simply returns the time from the remote server.

Creating the Axis Web Service Client


Creating the client is very straight-forward. Using the WSDL from the web service:
  1. Create a client services project to contain the WSDL file.
  2. Select the WSDL file in the project explorer.
  3. Right mouse-click -> Web Services -> Generate Client.
  4. Select the Apache Axis for Client Services type and remaining default options.

Apache Axis for Client Services

Assigning the Account


The wizard will update the plugin.xml to enable account integration. The plugin XML appears as the following.

<extension
         point="com.ibm.pvc.jndi.provider.java.binding">
      <binding
            jndi-name="com.ibm.rcp.support.ws.remote.RemoteSystem"
            objectFactory-id="com.ibm.rcp.ws.objectfactory.WSObjectFactory">
      </binding>
   </extension>
   <extension
         point="com.ibm.rcp.ws.objectfactory.WSfactoryobject">
      <WSobject
            account-key="Axis Sample"
            class="com.ibm.rcp.support.ws.remote.RemoteSystem"
            jndi-name="com.ibm.rcp.support.ws.remote.RemoteSystem">
      </WSobject>
   </extension>


Ensure the account-key value reflects an existing account. In the example, the account references a WebSphere Application Server v6.1 using LDAP security.

Axis Sample Account

Using the Account


When the web service client executes the following occurs.
  1. The Axis Sample account is retrieved by the Expeditor platform.
  2. An authentication request is made to the authentication URL in the account.
  3. A WS security header is constructed to contain the LTPA token obtained from step 2.
  4. The header and SOAP envelop are posted to the web service address obtained from the web service client code.

To ensure the platform creates an authenticated request using the web service, you must obtain the client code through JNDI.

Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,
				"com.ibm.pvc.jndi.provider.java.InitialContextFactory");

InitialContext ic = new InitialContext(env);

RemoteSystem rs = (RemoteSystem) ic.lookup("com.ibm.rcp.support.ws.remote.RemoteSystem");
		
System.out.println(rs.getSystemTime());


Sample Details


See article attachments for sample code.

remoteEAR.ear


A web service enterprise application; install as enterprise application on WebSphere Application Server.

com.ibm.rcp.support.ws.remote.client.axis


The Axis web service client services project.

com.ibm.rcp.support.axis.utll


An Axis account utility used to obtain an authenticated web service.

Running the Sample


On the OSGI console,execute the command start com.ibm.rcp.support.ws.remote.client.axis. The console will print the received time from the web service.

osgi> start com.ibm.rcp.support.ws.remote.client.axis
Tue Sep 14 19:29:58 EDT 2010
expanded Attachments (0)
collapsed Attachments (0)
expanded Versions (7)
collapsed Versions (7)
Version Comparison     
VersionDateChanged by              Summary of changes
7May 12, 2011 2:17:06 PMVan Staub  IBM contributor
6Oct 5, 2010 11:19:29 AMVan Staub  IBM contributor
5Oct 5, 2010 9:02:45 AMVan Staub  IBM contributor
4Sep 15, 2010 12:48:46 PMVan Staub  IBM contributor
This version (3)Sep 14, 2010 8:40:34 PMVan Staub  IBM contributor
2Sep 14, 2010 8:33:41 PMVan Staub  IBM contributor
1Sep 14, 2010 8:16:11 PMVan Staub  IBM contributor
Copy and paste this wiki markup to link to this article from another article in this wiki.
Go ElsewhereStay ConnectedHelpAbout
  • IBM Collaboration Solutions wikis
  • IBM developerWorks
  • IBM Software support
  • Twitter LinkIBMSocialBizUX on Twitter
  • FacebookIBMSocialBizUX on Facebook
  • ForumsLotus product forums
  • BlogsIBM Social Business UX blog
  • Community LinkIBM Collaboration Solutions
  • Wiki Help
  • Forgot user name/password
  • Wiki design feedback
  • Content feedback
  • About the wiki
  • About IBM
  • Privacy
  • Accessibility
  • IBM Terms of use
  • Wiki terms of use