Announcement Announcement Module
Collapse
No announcement yet.
Capturing a Response from a RestTemplate PUT Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Capturing a Response from a RestTemplate PUT

    I need some help on understanding the RestTemplate. I have a Restful/XML invocation I need to make that the client designed as a "PUT". (I think it would have been more appropriate as a POST). RestTemplate returns void on a PUT so I was trying to use execute but not understanding the nuances and wondered if anyone can point me to an example. I can see the following:

    System.out.println( restTemplate3.execute(url, HttpMethod.PUT, callback, responseExtractor));
    >> 14:01:04.479 [main] DEBUG o.s.web.client.RestTemplate - Created PUT request for "http://localhost:8080/quad-vm-bridge/quadvm/create?templateid=1&disk=1024&memory=512&cpu=1200"

    Tried a ResponseCallback returning an ClientHttpResponse and it doesn't break but don't know how to get to the information I need to apply MessageConverters for JaxB, which I've been using for the "GET"s.


    ClientHttpResponse httpResponse = restTemplate3.execute(url, HttpMethod.PUT, callback, responseExtractor);
    System.out.println(httpResponse);

    org.springframework.http.client.SimpleClientHttpRe sponse@523ce3f

    I need to map response from PUT back into Objects that my application can understand so I need OXM but am floundering trying to figure it out. Thanks in advance.
Working...
X