SetSecure メソッドを使用してセキュリティー情報を定義する場合は、 Web サービス・クライアント・アプリケーション にコードの行を追加して、GSKit の設定をセキュア・サービス用に構成する必要があります。GSKit セキュリティー情報は、アプリケーションが Web サービスに関するメソッドを呼び出す前に初期化する必要があります。
以下の例では、Web サービスを呼び出す前に、GSKit セキュリティー情報を構成する Windows 版のサンプル・クライアント・アプリケーションを示しています。ユーザーのアプリケーション内でセキュア設定を構成するには、この例の太字で示したコードを追加します。
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; }
詳細については、GSKit 構成の設定値を参照してください。