The moose likes Spring and the fly likes using XStreamMarshaller with restTemplate Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Application Frameworks » Spring
Reply Bookmark "using XStreamMarshaller with restTemplate" Watch "using XStreamMarshaller with restTemplate" New topic
Author

using XStreamMarshaller with restTemplate

venkatesh pendharkar
Ranch Hand

Joined: Apr 29, 2006
Posts: 104
Hi all,
I am trying to call a webservice using restTemplate.getForObject method. Following is the response that I am getting by this webservice:-
<orders>
<order>
<confirmationId>50001</confirmationId>
........
......
</order>
<order>
<confirmationId>52000</confirmationId>
......
.....
</order>
</orders>

I need to use addImplicitCollection method of xstream but i do not know how to use this in spring configuration. Following is my configuraion:-
<bean id="restTemplate" class="org.springframework.web.client.RestTemplate">
<constructor-arg ref="httpClientFactory"/>
<property name="messageConverters">
<list>
<bean class="org.springframework.http.converter.xml.MarshallingHttpMessageConverter">

<constructor-arg>
<bean class="org.springframework.oxm.xstream.XStreamMarshaller">

<property name="aliases">
<props>
<prop key="orders">com.entertainment.epintegration.webservice.model.CPCFulfillmentModel</prop>
<prop key="order">com.entertainment.epintegration.webservice.model.CPCOrderFulfillmentModel</prop>
</props>
</property>
</bean>
</constructor-arg>
</bean>
</list>
</property>
</bean>

Can any one please help me to understand how to use addImplicitCollection in above configuration?


Thanks
Venkatesh Pendharkar
Rod Silva
Greenhorn

Joined: Dec 23, 2010
Posts: 2
I am facing same problem... do you have a solution yet?
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 16624

I can't read your XML, where are your CODE tags to keep the indentation???

Thanks

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Rod Silva
Greenhorn

Joined: Dec 23, 2010
Posts: 2
Did anyone find a solution this problem? Please advise. Thank you.
 
 
subject: using XStreamMarshaller with restTemplate
 
Threads others viewed
Queue and session is closed! problem
calling a method in hibernate DAO through JMX export MBean
How to wire-up TransactionProxyFactoryBean & HibernateInterceptor ?
Could not initialize JBossWorkManagerTaskExecutor because JBoss API is not available: java.lang.refl
Struts Validation in Spring Context
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com