0

我正在尝试将适用于 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;
}
4

0 回答 0