Announcement Announcement Module
Collapse
No announcement yet.
how to log in RestTemplate Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • how to log in RestTemplate

    ReturnedObject returnedObject = myRestTemplate.postForObject(Constants.Url, queryMap,ReturnedObject .class);

    and this is the definition of myRestTemplate in applicationContext.xml:

    <bean id="myRestTemplate" class="org.springframework.web.client.RestTemplate ">
    <constructor-arg ref="httpClientFactory" />
    <property name="messageConverters">
    <list>
    <bean class="org.springframework.http.converter.FormHttp MessageConverter" />
    <bean class="org.springframework.http.converter.xml.Mars hallingHttpMessageConverter">
    <property name="marshaller" ref="myCastorMarshaller" />
    <property name="unmarshaller" ref="myCastorMarshaller" />
    </bean>
    </list>
    </property>
    </bean>

    it runs perfectly. the only thing is that when the returned xml come back, it gets unmarshalled to the java object by myCastorMarshaller right away, I do not have a chanve to log the xml that has coming back from the remote call. it is important to log the return xml.

    Is there anyway which I could log the xml returned from the http call?

    Thanks in advance!
Working...
X