简体   繁体   English

WSSEcurityContext不会出现在WebLogic12c上

[英]WSSEcurityContext doen't appear on WebLogic12c

Hello I have my application on weblogic 12C and I need consume a WSDL but I have that add the UsernamToken on security header. 您好,我的应用程序在weblogic 12C上,我需要使用WSDL,但是我在安全标头上添加了UsernamToken。

I am tying the next: 我绑下一个:

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);

the problem here is relative simple. 这里的问题相对简单。 And is that the weblogic server 12c (12.1.3) doesn't find the class WSSecurityContext on the package: 而且是weblogic服务器12c(12.1.3)在包上找不到类WSSecurityContext:

 import weblogic.xml.crypto.wss.WSSecurityContext;

Are you using SOAP Message? 您正在使用SOAP消息吗? Then you can put the user name password in your handler chain. 然后,您可以将用户名密码放入处理程序链中。 Here your headerhandler object will be of the request object type. 在这里,您的标头处理程序对象将是请求对象类型。

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

Hope this helps 希望这可以帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM