My apologies. Please ignore my earlier reply. I sent the response to the wrong mail thread.
Thanks a lot Jose, I was able to use factoryBean to achieve the desired result. Thanks, Giriraj. On Thu, Jul 17, 2014 at 6:28 PM, Giriraj Bhojak <girira...@gmail.com> wrote: > I just found out that if I introduce another key in the keystore with some > password, I get following: > > Caused by: java.security.UnrecoverableKeyException: Cannot recover key > at com.ibm.crypto.provider.s.recover(s.java:90) > at > com.ibm.crypto.provider.JavaKeyStore.engineGetKey(JavaKeyStore.java:256) > at java.security.KeyStore.getKey(KeyStore.java:803) > at com.ibm.jsse2.uc.<init>(uc.java:113) > at com.ibm.jsse2.cc$a_.engineInit(cc$a_.java:15) > at javax.net.ssl.KeyManagerFactory.init(KeyManagerFactory.java:16) > at > org.apache.cxf.configuration.jsse.TLSParameterJaxBUtils.getKeyManagers(TLSParameterJaxBUtils.java:279) > > If I delete the new entry from the keystore, my test works fine, so the > moment I have another protected key in keystore, I get > UnrecoverableKeyException. > Do I need to setup something in order to avoid it? > > Thanks, > Giriraj. > > > On Thu, Jul 17, 2014 at 3:06 AM, Jose María Zaragoza <demablo...@gmail.com > > wrote: > >> 2014-07-17 0:11 GMT+02:00 Giriraj Bhojak <girira...@gmail.com>: >> > Thank you for the quick response. >> > >> > Could you point me to an example of using JAXWS proxy-client's factory? >> > Did you mean org.apache.cxf.jaxws.JaxWsProxyFactoryBean class? >> >> Yes, for example. >> Well, I'm not an expert. I think JaxWsProxyFactoryBean returns a new >> instance , so it's safe to modify in runtime interceptors for it >> Maybe you could extend JaxWsProxyFactoryBean and caching instances >> according some parameter >> >> >> >> > >> > Thanks, >> > Giriraj. >> > >> > >> > On Wed, Jul 16, 2014 at 5:55 PM, Jose María Zaragoza < >> demablo...@gmail.com> >> > wrote: >> > >> >> 2014-07-16 23:29 GMT+02:00 Giriraj Bhojak <girira...@gmail.com>: >> >> > Hello, >> >> > I have used Spring based configuration to define a jaxws client. >> >> > The spring bean looks something on following lines: >> >> > >> >> > <jaxws:client id="id" >> >> > serviceClass="SomeClass" address=someAddress> >> >> > <jaxws:inInterceptors> >> >> > <ref bean="inInterceptor" /> >> >> > <bean >> >> > >> class="org.apache.cxf.ws.security.wss4j.DefaultCryptoCoverageChecker" /> >> >> > </jaxws:inInterceptors> >> >> > <jaxws:outInterceptors> >> >> > <ref bean="outInterceptor" /> >> >> > </jaxws:outInterceptors> >> >> > </jaxws:client> >> >> > >> >> > I need to use the same client definition for more than one client. I >> >> don't >> >> > see scope attribute in <jaxws:client> >> >> > Is there a way to use same definition for multiple clients? >> >> >> >> Maybe you can have a look at: >> >> http://cxf.apache.org/faq.html#FAQ-AreJAX-WSclientproxiesthreadsafe? >> >> >> >> >> >> > >> >> > Also, I am using <bean >> >> > class="org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor" > as >> the out >> >> > interceptor. >> >> > There is a key 'encryptionUser' that can be used to provide user's >> name >> >> for >> >> > encryption. >> >> > <entry key="encryptionUser" value="endPoint1" /> >> >> > Is there a way I can use same bean definition of WSS4JOutInterceptor >> and >> >> > specify different 'encryptionUser' for each invocation of the jaxws >> >> client? >> >> > >> >> > Basically, I want to have a way to use same spring bean definitions >> to >> >> call >> >> > different web services endpoints. >> >> >> >> I'm not sure if it's a good idea. >> >> Maybe you could use a JAXWS proxy-client's factory and set >> >> interceptors for each proxy-client in runtime. >> >> As every factory of objects, you could implement some kind of cache >> >> >> >> >> >> > Could someone please help me with it? >> >> > >> >> > Thanks, >> >> > Giriraj. >> >> >> > >