Announcement Announcement Module
Collapse
No announcement yet.
prototype MethodInvokingFactoryBean Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • 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:

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

    Comment


    • #3
      finished

      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.

      Greetings!

      Comment

      Working...
      X