WebSphere Message Service Clients: Web Services Client for C++, Version 1.1 Operating Systems: Linux, Windows

Security information defined using the SetSecure method

If you are defining security information using the SetSecure method, you must add a line of code to your web service client application to configure the GSKit settings for the secure service. The GSKit security information must be initialized before the application calls any methods on the web service.

The following example shows a Windows version of a sample client application that configures GSKit security information before calling a web service. To configure the secure setting within your own application, add the code shown in bold in this example.

int main()
{
// Create URLs for normal and secure communication.  The localhost may require
// a port number, i.e. localhost:80
  char * pszNormalURL = "http://localhost/Test/services/TestPort";
  char * pszSecureURL = "https://localhost/Test/services/TestPort";

// Load instances of the service with normal and secure URL settings.
  ITestService * serviceNormal = new ITestService( pszNormalURL);
  ITestService * serviceSecure = new ITestService( pszSecureURL);

// Initialise the secure settings for the secure service.
  serviceSecure->SetSecure( "<GSKit_InstDir><KeyRing.kbd>",
                            "<password or stash>",
                            "<label>", "NONE", "05", "NONE", false);
// Remainder of application
: 
// End of application

    delete serviceSecure;
    delete serviceNormal;

    return 0;
} 
Note: The <password or stash> parameter can be replaced with a stash file containing an encrypted password, so that the ‘raw’ password does not appear in the code or configuration file. The stash file has the same format as the key ring database definition, but the extension must be ‘.sth’ (for example, <GSKit_InstDir><KeyRing.sth>).

For further information see GSKit configuration settings.

Related tasks
Securing web service communications
Specifying secure endpoints
Related reference
GSKit configuration settings

Concept topic

Terms of Use | Rate this page

Last updated: 25 Jan 2006

© Copyright IBM Corporation 2005, 2006. All Rights Reserved.