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