从Websphere 8.5迁移到Tomcat 8.5 API

时间:2018-03-28 20:56:50

标签: java tomcat migration websphere server-migration

我正在尝试将一段适用于Websphere 8.5的代码迁移到Tomcat 8.5。

一段代码使用了一些导入:

import com.ibm.websphere.wssecurity.callbackhandler.UNTGenerateCallbackHandler;
import com.ibm.websphere.wssecurity.wssapi.WSSFactory;
import com.ibm.websphere.wssecurity.wssapi.WSSGenerationContext;
import com.ibm.websphere.wssecurity.wssapi.token.SecurityToken;
import com.ibm.websphere.wssecurity.wssapi.token.UsernameToken

我可以用什么来代替这些来使代码工作?

使用它的代码片段是:

WSSFactory factory;
try {
    factory = WSSFactory.getInstance();
    WSSGenerationContext context = factory.newWSSGenerationContext();
    UNTGenerateCallbackHandler callbackHandler = new UNTGenerateCallbackHandler(userName, password);
    SecurityToken token = factory.newSecurityToken(UsernameToken.class, callbackHandler);
    context.add(token);
    context.process(soapMessageContext);
} catch (Exception e) {
    return false;
}

0 个答案:

没有答案