Announcement Announcement Module
Collapse
No announcement yet.
problem with "request" scoped bean Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    At first glance, I don't see any errors in your config, and this should work. Could you also share your EndpointMapping configuration, please?

    Comment


    • #3
      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

      Comment


      • #4
        I forgot to say I'm using 1.5.0 M2.

        Luciano

        Comment


        • #5
          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.

          Comment

          Working...
          X