java - Can we use multiple message factories in Spring WS? -
i solved problem of direct streaming spring ws, arjen fast response. trick disable payload caching in axiom message factory.
i suffering global decision, have either enable or disable payload caching whole system. have webservices streaming , enables validation (which not possible if payload caching disabled)
so possible map specific endpoint specific message factory? it's easy webservice clients, endpoints? ideas?
thank you!
you're right, it's easy on client side passing specific webservicemessagefactory
instance webservicetemplate
constructor.
anyway, guess it's possible on server side. if can use different url mappings, simplest way found out based on configuration of 2 (or more) differents messagedispatcherservlet
in web.xml
. have pass init parameter specific bean name of webservicemessagefactory
instance prefer. this:
<servlet> <servlet-name>ws1</servlet-name> <servlet-class>org.springframework.ws.transport.http.messagedispatcherservlet</servlet-class> <init-param> <param-name>contextconfiglocation</param-name> <param-value>/web-inf/conf/ws1-servlet.xml</param-value> </init-param> <init-param> <param-name>messagefactorybeanname</param-name> <param-value>defaultmessagefactory</param-value> </init-param> </servlet> <servlet> <servlet-name>ws2</servlet-name> <servlet-class>org.springframework.ws.transport.http.messagedispatcherservlet</servlet-class> <init-param> <param-name>contextconfiglocation</param-name> <param-value>/web-inf/conf/ws2-servlet.xml</param-value> </init-param> <init-param> <param-name>messagefactorybeanname</param-name> <param-value>streamingmessagefactory</param-value> </init-param> </servlet> <servlet-mapping> <servlet-name>ws1</servlet-name> <url-pattern>/ws1</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>ws2</servlet-name> <url-pattern>/ws2</url-pattern> </servlet-mapping>
then, have add different message factory beans spring-ws context.
hope helps.
Comments
Post a Comment