Bitaholic

WS-Security 인증이 된 Weblogic Webservice client 작성 본문

Computer/WebService

WS-Security 인증이 된 Weblogic Webservice client 작성

Bitaholic ...Simple is beautiful Bitaholic 2008. 3. 31. 22:34

간단한 Username/Password WS-security로 Weblogic Server에 설정된 WebService호출하기.

 

import weblogic.xml.crypto.wss.provider.CredentialProvider;

import weblogic.xml.crypto.wss.WSSSecurityContext;

import weblogic.wsee.security.bst.ClientUNTCredentialProvider;

.

.

.

 

String username="weblogic";

String password="weblogic";

 

List CredProviders = new ArrayList();

 

//Sample Webservice Client 스텁 생성

SecureHelloWorldService service = new SecureHelloWorldService_Impl("wsdl_address");

SecureHelloWorldPortType port = service.getSecureHelloWorldServicePort();

 

//Username, password Provider 생성

CredentialProvider cp = new ClientUNTCredentialProvider(username.getByte(), password.getByte());

credProviders.add(cp);

 

Stub stub = (Stub)port;

 

stub._setProperty(WSSecurityContext.CREDENTIAL_CREDENTIAL_PROVIDER_LIST, credProviders);

 

String response = port.sayHello("world");

 

.

.

.

3 Comments
댓글쓰기 폼