Results 1 to 5 of 5

Thread: problem with "request" scoped bean

  1. #1
    Join Date
    Feb 2007
    Posts
    20

    Default problem with "request" scoped bean

    I'm getting craxy with a trivial problem (I hoped):
    I need to pass an object from an EndpointInterceptor to an
    Endpoint (derived from AbstractMarshallingPayloadEndpoint).
    Then I defined in spring-ws-servlet.xml file a "request" scoped bean
    :
    Code:
    <bean id="integrazione"
    class="it.almaviva.model.springws.IntegrazioneImpl" scope="request">
    <aop:scoped-proxy proxy-target-class="false" />
    </bean>
    added a RequestContextListener in web.xml:

    Code:
    ...
    <listener>
    <listener-class>
    org.springframework.web.context.ContextLoaderListener
    </listener-class>
    </listener>
    <listener>
    <listener-class>
    org.springframework.web.context.request.RequestContextListener
    </listener-class>
    </listener>
    ...
    and then iniected the bean in the interceptor and endpoint

    Code:
    ...
    <bean id="integrazioneInterceptor"
    class="it.almaviva.springws.interceptors.IntegrationHeaderInterceptor"
    p:integra-ref="integrazione" />
    
    <bean id="GetContattiByCittaAsynchSimmMarshallingEndpoint"
    class="it.almaviva.springws.GetContattiByCittaAsynchSimmMarshallingEndpoint"
    p:service-ref="contattiService" p:marshaller-ref="contattiMarshaller"
    p:unmarshaller-ref="nomecittaasyncUnMarshaller"
    p:integra-ref="integrazione" p:jmsTemplate-ref="jmsTemplate" />
    ....
    What i would expect is that modifing the bean "integrazione" in interceptor i could then read the changes in the endpoint, but it doesn't work and in the endpoint i see another bean with unmodified properties.
    Could you see anything wrong in my configuration?

    P.S.
    Using ThreadLocal instead of Spring injection works.

    Thanks

    Luciano

  2. #2
    Join Date
    Jul 2005
    Location
    Rotterdam, the Netherlands
    Posts
    1,562

    Default

    At first glance, I don't see any errors in your config, and this should work. Could you also share your EndpointMapping configuration, please?
    Arjen Poutsma

    Spring Web Services Dev Lead
    Please read the FAQ

  3. #3
    Join Date
    Feb 2007
    Posts
    20

    Default

    This is the EndpointMapping configuration:
    Code:
    	<bean id="payloadMapping"
    		class="org.springframework.ws.server.endpoint.mapping.PayloadRootQNameEndpointMapping">
    		<property name="interceptors">
    			<list>
    				<ref bean="integrazioneInterceptor" />
    			</list>
    		</property>
    		<property name="endpointMap">
    			<map>
    				<entry
    					key="{http://luciano.mytest.com/schema/spcoop}pkparm"
    					value-ref="getContattoMarshallingEndpoint" />
    				<entry
    					key="{http://luciano.mytest.com/schema/spcoop}nomecittaparm"
    					value-ref="getContattiByCittaMarshallingEndpoint" />
    				<entry
    					key="{http://luciano.mytest.com/schema/spcoop}nomecittaasyncparm"
    					value-ref="getContattiByCittaAsynchSimmMarshallingEndpoint" />
    				<entry
    					key="{http://luciano.mytest.com/schema/spcoop}contatti"
    					value-ref="notificaResultContattiByCittaAsynchSimmMarshallingEnpoint" />
    			</map>
    		</property>
    	</bean>
    Luciano

  4. #4
    Join Date
    Feb 2007
    Posts
    20

    Default

    I forgot to say I'm using 1.5.0 M2.

    Luciano

  5. #5
    Join Date
    Feb 2007
    Posts
    20

    Default

    Only to let you know that it was a problem in my java code . There wasn't any problem in Spring, Spring Web Services and bean configuration.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •