Do you have any other pointer that this page : cxf.apache.org/docs/ws-securitypolicy.html
it's way to short for me as documentation to build something that work. When I read the properties described, I feel there's a mix between server side properties (which I'm not interested as I'm just implementing a client)... + it starts with extra properties... where are the basic ones? what would help is a full example of the code of a client. I'm quite lost ;) On Fri, Jul 12, 2013 at 5:09 PM, Colm O hEigeartaigh <[email protected]>wrote: > > If you follow the WS-SecurityPolicy approach then it will work, as all of > the configuration is taken from the context rather than a properties Map. > > Colm. > > > On Fri, Jul 12, 2013 at 4:01 PM, Thomas Manson <[email protected] > > wrote: > >> I already does what you say as follow, but it mean one instance of the >> client per user connected. >> >> >> I've search quite some time dans didn't find a way to set something like >> the password callback handler. >> >> >> >> JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean(); >> >> factory.setServiceClass(WorkListService.class); >> >> factory.setAddress(this.endpoint); >> >> // >> factory.setWsdlLocation("D:/ARTIC/SOURCE/artic/trunk/webapp/src/main/webapp/WSDL/brm.wsdl"); >> >> factory.setServiceName(new QName("http://services.brm.n2.tibco.com", >> "WorkListService")); >> >> WorkListService workListService = (WorkListService) factory.create(); >> >> >> Client client = ClientProxy.getClient(workListService); >> >> >> Map<String, Object> properties = new HashMap<String, Object>(); >> >> properties.put(WSHandlerConstants.ACTION , >> WSHandlerConstants.USERNAME_TOKEN); >> >> properties.put(WSHandlerConstants.USER , this.username); >> >> properties.put(WSHandlerConstants.PASSWORD_TYPE , WSConstants. >> PW_TEXT);// "PasswordDigest" >> >> properties.put(WSHandlerConstants.PW_CALLBACK_REF , >> newPasswordCallbackHandler( >> this.username, password, "password")); >> >> >> client.getOutInterceptors().add(new WSS4JOutInterceptor(properties)); >> >> >> On Fri, Jul 12, 2013 at 4:36 PM, Colm O hEigeartaigh <[email protected] >> > wrote: >> >>> ou could create a CXF interceptor that sets the username on the fly, >>> before the WSS4JOutInterceptor is called. >> >> >> >> > > > -- > Colm O hEigeartaigh > > Talend Community Coder > http://coders.talend.com >
