SetSecure 메소드를 사용하여 보안 정보를 정의할 경우 한 행의 코드를 웹 서비스 클라이언트 응용프로그램에 추가하여 보안 서비스에 대한 GSKit 설정을 구성해야 합니다. 응용프로그램이 웹 서비스의 메소드를 호출하기 전에 GSKit 보안 정보를 초기화해야 합니다.
다음은 웹 서비스를 호출하기 전에 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을 참조하십시오.