prototype MethodInvokingFactoryBean
Hello, i hope somebody help me please with this.
I'm working with JaxRpcPortProxyFactoryBeans, i'm consuming a web service that get a session id, then i have to atach it to an other bean (that calls the same web service) at it's endpointAddress (for autentication subject).
I do this with a MethodInvokingFactoryBean:
Code:
<bean id="loginService" class="org.springframework.remoting.jaxrpc.JaxRpcPortProxyFactoryBean" lazy-init="true">
<property name="wsdlDocumentUrl" value="$XYZ{SessionServiceWSDL}"/>
<property name="serviceInterface" value="com.xxx...SessionService"/>
<property name="portName" value="thePort"/>
<property name="serviceName" value="theService"/>
<property name="namespaceUri" value="$XXX{theServiceURI}"/>
<property name="servicePostProcessors">
<list>
<bean class="com.xxx....SessionServicePostProcessor"/>
</list>
</property>
</bean>
<bean id="loginInvokingFactoryBean" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean" scope="prototype" lazy-init="true">
<property name="targetObject" ref="loginService"/>
<property name="targetMethod" value="login"/>
<property name="arguments">
<list>
<bean class="com.xxx...LoginData">
<property name="username" value="$XYZ{CfgUserName}"/>
<property name="password" value="$XYZ{CfgPassword}"/>
</bean>
</list>
</property>
</bean>
I have to define the "loginInvokingFactoryBean" scope as prototype because at some point in the app i need to get at every call a new sessionID, but contradictorily at every call i have to set this value at 3 diferent JaxRpcPortProxyFactoryBean beans (at properties).
I try to do this with "util:property-path", "PropertyPathFactoryBean" but doesn't keep the same value for the 3 beans. Is there some hack to do this? Please help me, i'm confused. Thank you.