首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >WebLogic12c上没有出现WSSEcurityContext

WebLogic12c上没有出现WSSEcurityContext
EN

Stack Overflow用户
提问于 2015-12-23 00:04:45
回答 1查看 522关注 0票数 1

你好,我在WebLogic12C上有我的应用程序,我需要使用WSDL,但我让它在安全头上添加UsernamToken。

我要做的是下一个:

代码语言:javascript
复制
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:

代码语言:javascript
复制
 import weblogic.xml.crypto.wss.WSSecurityContext;
EN

回答 1

Stack Overflow用户

发布于 2016-01-13 21:46:35

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

代码语言:javascript
复制
List<Handler> handlerChain = new ArrayList<Handler>();
handlerChain.add(headerHandler);
Binding binding = bindingProvider.getBinding();
binding.setHandlerChain(handlerChain);

希望这能有所帮助

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/34419868

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档