gpt4 book ai didi

java - WSSEcurityContext 未出现在 WebLogic12c 上

转载 作者:太空宇宙 更新时间:2023-11-04 13:06:04 24 4
gpt4 key购买 nike

您好,我在 weblogic 12C 上有我的应用程序,我需要使用 WSDL,但我在安全 header 上添加了 UsernamToken。

我正在绑定(bind)下一个:

gt.com.pro.wsdl.SMSServiceService service = new gt.com.pro.wsdl.SMSServiceService();
gt.com.pro.wsdl.SMSServicePortType port = service.getSMSServiceHTTPPort();
AddressingFeature feature = new AddressingFeature(true, false);
port = service.getSMSServiceHTTPPort(feature);
ObjectFactory objectFactory = new ObjectFactory();
DatatypeFactory dttFact = DatatypeFactory.newInstance();
List<CredentialProvider> credenciales = new ArrayList();
credenciales.add(new ClientUNTCredentialProvider(usuario.getBytes(), clave.getBytes()));
Map<String, Object> rc = ((BindingProvider) port).getRequestContext();
rc.put(WSSecurityContext.CREDENTIAL_PROVIDER_LIST, credenciales);

这里的问题相对简单。并且weblogic服务器12c(12.1.3)在包上找不到类WSSecurityContext:

 import weblogic.xml.crypto.wss.WSSecurityContext;

最佳答案

您使用 SOAP 消息吗?然后您可以将用户名密码放入您的处理程序链中。这里你的 headerhandler 对象将是请求对象类型。

List<Handler> handlerChain = new ArrayList<Handler>();
handlerChain.add(headerHandler);
Binding binding = bindingProvider.getBinding();
binding.setHandlerChain(handlerChain);

希望这有帮助

关于java - WSSEcurityContext 未出现在 WebLogic12c 上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34419868/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com