Announcement Announcement Module
No announcement yet.
prototype MethodInvokingFactoryBean Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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:

    <bean id="loginService" class="org.springframework.remoting.jaxrpc.JaxRpcPortProxyFactoryBean" lazy-init="true">
    		<property name="wsdlDocumentUrl" value="$XYZ{SessionServiceWSDL}"/>
    		<property name="serviceInterface" value=""/>
    		<property name="portName" value="thePort"/>
    		<property name="serviceName" value="theService"/>
    		<property name="namespaceUri" value="$XXX{theServiceURI}"/>
    		<property name="servicePostProcessors">
    				<bean class=""/>
    <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">
    				<bean class="">
    					<property name="username" value="$XYZ{CfgUserName}"/>
    					<property name="password" value="$XYZ{CfgPassword}"/>

    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 "utilroperty-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.

  • #2
    yeah ive been having a similar problem...ill keep my eye on this one


    • #3

      Ok, it's done and working. I have to change my approach of the problem, creating and calling this beans in a new inner ApplicationContext.