On Mon, Jul 9, 2012 at 10:43 AM, atg roxx <[email protected]> wrote: > Hi All, > > Could anyone please give their thought over this problem. >
Have you looked at spring ws documentation / forum etc. As it must be a similar problem there. Or maybe you can extend org.apache.commons.httpclient.UsernamePasswordCredentials and dynamic decide the username / password to return in the callbacks. I am not sure how easy that would be through, as I assume the callbacks is just getUsername / getPassword etc. But haven't looked myself > --Regards, > atgroxx > live thie moment!! > > On Fri, Jul 6, 2012 at 5:45 PM, atg roxx <[email protected]> wrote: > >> Hi Team, >> >> I have some un usual requirement. >> >> >> I have to send spring-ws request to third party which require two level of >> authentication (server+application) >> >> I have overridden the CommonsHttpMessageSender for it as shown below. >> ---------------- >> <bean id="messageSenderTest" >> class="com.estar.eif.sbe.helper.TestCommonsHttpMessageSender"> >> <constructor-arg index="0" ref="httpClient" /> >> <constructor-arg index="1" value="${request.header.username.gb}" >> /> >> <constructor-arg index="2" value="${request.header.password.gb}" >> /> >> <property name="credentials"> >> <bean >> class="org.apache.commons.httpclient.UsernamePasswordCredentials"> >> <constructor-arg index="0" value="${username}" /> >> <constructor-arg index="1" value="$password}" /> >> </bean> >> </property> >> <property name="connectionTimeout" value="${connectiontimeout}" /> >> <property name="readTimeout" value="${readtimeout}" /> >> </bean> >> ------------ >> >> and I am using the Dynamic registry based option messageSender like this >> -------------- >> "?messageFactory=#messageFactory&messageSender=#messageSenderTest >> ------------------- >> >> And it is working perfectly fine :). >> >> Now the issue is, there is requirement change from our client that he want >> to us to send different username/password for different request and there >> are around 30 different request. >> >> Now one solution can be that I create 30 messageSender and depending upon >> the request use the corresponding message sender. But it doesn't feel right >> to me. >> >> Could anyone suggest some other way to do it in more proper way.? >> Is there anyways we can change the username/password dynamically or the >> messageSender.? >> >> >> --- >> Regards, >> atgroxx >> Live the Moment. >> >> >> >> >> -- Claus Ibsen ----------------- FuseSource Email: [email protected] Web: http://fusesource.com Twitter: davsclaus, fusenews Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen
