Announcement Announcement Module
Collapse
No announcement yet.
How to implement (SWS-352) Full streaming WebServiceMessage? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to implement (SWS-352) Full streaming WebServiceMessage?

    How to implement endpoint using this funktionality? -SWS-352 Full streaming WebServiceMessage/SoapMessage.
    I have tried to implement some simple endpoint using spring ws 2.0.0-M4-SNAPSHOT that seems to contain this fix.

    Do you have any complete example of this new org.springframework.ws.stream.StreamingWebServiceM essage in use. How to implement working endpoint using full streaming?

    So far I can not figure out how to get JaxbElementPayloadMethodProcessor in use.
    It seems that DefaultMethodEndpointAdapter inits it in methodReturnValueHandlers.add(new JaxbElementPayloadMethodProcessor()); but it still doesn't use it.
    How to hook JaxbMarshaler behind DefaultMethodEndpointAdapter?

    I use @Endpoint annotated Spring bean that handles Jaxb generated Request and Response in @PayloadRoot annotated method.
    Program works ok but with debugger I can see that this new funktionality is not in use.

    Spring config looks like this:
    Code:
         <bean id="messageFactory" class="org.springframework.ws.soap.axiom.AxiomSoapMessageFactory">
    	<property name="payloadCaching" value="false" />
         </bean>
    
         <bean class="org.springframework.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping" />
    
         <bean id="eightBallEndpoint" class="jaxb.eightball.ws.EightBallEndpoint">
         <description>
                 This endpoint handles requests.
             </description>
             <property name="eightBallService" ref="eightBallService"/>
         </bean>
    
          <bean id="eightBallService" class="jaxb.eightball.service.impl.EightBallServiceImpl"></bean>
    
         <bean class="org.springframework.ws.server.endpoint.adapter.DefaultMethodEndpointAdapter">
         </bean>
    
        <bean id="deprecatedAdapter" class="org.springframework.ws.server.endpoint.adapter.GenericMarshallingMethodEndpointAdapter">
            <constructor-arg ref="marshaller"/>
        </bean>
    
        <bean class="org.springframework.ws.server.endpoint.adapter.method.MarshallingPayloadMethodProcessor">
            <constructor-arg ref="marshaller"/>
        </bean>
    
        <bean id="marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller">
            <property name="classesToBeBound">
                <list>
                    <value>jaxb.eightball.EightBallRequest</value>
                    <value>jaxb.eightball.EightBallResponse</value>
                </list>
            </property>
        </bean>
    </beans>

  • #2
    Hello,

    I think that in this example, the (deprecated) GenericMarshallingMethodEndpointAdapter is the one that picks up the request, and as DefaultMethodEndpointAdapter does not do anything, JaxbElementPayloadMethodProcessor wired into it does not get used either.

    So GenericMarshallingMethodEndpointAdapter should be removed from the config. But how should one go about to get MarshallingPayloadMethodProcessor hooked up to the new DefaultMethodEndpointAdapter ?

    Or is this the right about at all?

    Any code example using the new StreamingPayload would be most welcome.

    Essentially we need to be able to stream the whole response without storing it wholly in memory at any moment.

    Best wishes,
    Timo

    Comment

    Working...
    X