WebSphere Web Services Client for C++, Version 1.0.1 Operating Systems: Linux, Solaris

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.


Concept topic

Terms of Use | Rate this page

Timestamp iconLast updated: 12 Dec 2005
(C) Copyright IBM Corporation 2005. All Rights Reserved.
This information center is powered by Eclipse technology. (http://www.eclipse.org)