<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.2.2" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: RestTemplate, the Spring way of accessing RESTful services</title>
	<link>http://aruld.info/resttemplate-the-spring-way-of-accessing-restful-services/</link>
	<description>Life, Technology and More</description>
	<pubDate>Fri, 30 Jul 2010 10:39:44 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.2</generator>

	<item>
		<title>By: Fray</title>
		<link>http://aruld.info/resttemplate-the-spring-way-of-accessing-restful-services/#comment-3920</link>
		<author>Fray</author>
		<pubDate>Tue, 22 Sep 2009 19:05:35 +0000</pubDate>
		<guid>http://aruld.info/resttemplate-the-spring-way-of-accessing-restful-services/#comment-3920</guid>
		<description>Thanks...wow it is very helpful blog for SSL &#38; resttemplate stuff..

Very helpful info.</description>
		<content:encoded><![CDATA[<p>Thanks&#8230;wow it is very helpful blog for SSL &amp; resttemplate stuff..</p>
<p>Very helpful info.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arul</title>
		<link>http://aruld.info/resttemplate-the-spring-way-of-accessing-restful-services/#comment-3919</link>
		<author>Arul</author>
		<pubDate>Mon, 21 Sep 2009 20:01:17 +0000</pubDate>
		<guid>http://aruld.info/resttemplate-the-spring-way-of-accessing-restful-services/#comment-3919</guid>
		<description>Hi Fray,

Nice to see you got it working with SSL. 
Btw, I just blogged about accessing SSL configured resources using RestTemplate &lt;a href="http://aruld.info/accessing-restful-services-configured-with-ssl-using-resttemplate/" rel="nofollow"&gt;here&lt;/a&gt;.

You may want to look at the &lt;a href="http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/http/converter/json/MappingJacksonHttpMessageConverter.html" rel="nofollow"&gt;MappingJacksonHttpMessageConverter&lt;/a&gt; which supports "application/json".

Cheers,
Arul</description>
		<content:encoded><![CDATA[<p>Hi Fray,</p>
<p>Nice to see you got it working with SSL.<br />
Btw, I just blogged about accessing SSL configured resources using RestTemplate <a href="http://aruld.info/accessing-restful-services-configured-with-ssl-using-resttemplate/" rel="nofollow">here</a>.</p>
<p>You may want to look at the <a href="http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/http/converter/json/MappingJacksonHttpMessageConverter.html" rel="nofollow">MappingJacksonHttpMessageConverter</a> which supports &#8220;application/json&#8221;.</p>
<p>Cheers,<br />
Arul</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fray</title>
		<link>http://aruld.info/resttemplate-the-spring-way-of-accessing-restful-services/#comment-3918</link>
		<author>Fray</author>
		<pubDate>Mon, 21 Sep 2009 17:18:32 +0000</pubDate>
		<guid>http://aruld.info/resttemplate-the-spring-way-of-accessing-restful-services/#comment-3918</guid>
		<description>Arul
I got the SSL work, thanks to your links and direction.

Once more question: I format the return from Rest Servie as a json. In spring 3M4, there is no coverter for Json, I saw you using the FormHttpMessageConverter. How would you handle when stuff return are in JSON format

again greatly appreciated</description>
		<content:encoded><![CDATA[<p>Arul<br />
I got the SSL work, thanks to your links and direction.</p>
<p>Once more question: I format the return from Rest Servie as a json. In spring 3M4, there is no coverter for Json, I saw you using the FormHttpMessageConverter. How would you handle when stuff return are in JSON format</p>
<p>again greatly appreciated</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arul</title>
		<link>http://aruld.info/resttemplate-the-spring-way-of-accessing-restful-services/#comment-3916</link>
		<author>Arul</author>
		<pubDate>Fri, 18 Sep 2009 05:31:44 +0000</pubDate>
		<guid>http://aruld.info/resttemplate-the-spring-way-of-accessing-restful-services/#comment-3916</guid>
		<description>Hi Fray,

No problem.

You may want to look at the Jersey client &lt;a href="https://jersey.dev.java.net/source/browse/jersey/trunk/jersey/samples/https-clientserver-grizzly/" rel="nofollow"&gt;sample&lt;/a&gt; used to access a secured resource. This would give you an idea on how to setup TrustManager and KeyManager on the client.

Cheers,
Arul</description>
		<content:encoded><![CDATA[<p>Hi Fray,</p>
<p>No problem.</p>
<p>You may want to look at the Jersey client <a href="https://jersey.dev.java.net/source/browse/jersey/trunk/jersey/samples/https-clientserver-grizzly/" rel="nofollow">sample</a> used to access a secured resource. This would give you an idea on how to setup TrustManager and KeyManager on the client.</p>
<p>Cheers,<br />
Arul</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fray</title>
		<link>http://aruld.info/resttemplate-the-spring-way-of-accessing-restful-services/#comment-3915</link>
		<author>Fray</author>
		<pubDate>Thu, 17 Sep 2009 13:25:18 +0000</pubDate>
		<guid>http://aruld.info/resttemplate-the-spring-way-of-accessing-restful-services/#comment-3915</guid>
		<description>Thanks Arul, that helps. I am looking into it .
Greatly appreciated your direction and time to help out.</description>
		<content:encoded><![CDATA[<p>Thanks Arul, that helps. I am looking into it .<br />
Greatly appreciated your direction and time to help out.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arul</title>
		<link>http://aruld.info/resttemplate-the-spring-way-of-accessing-restful-services/#comment-3914</link>
		<author>Arul</author>
		<pubDate>Thu, 17 Sep 2009 02:47:19 +0000</pubDate>
		<guid>http://aruld.info/resttemplate-the-spring-way-of-accessing-restful-services/#comment-3914</guid>
		<description>Hi Fray,

I did receive your email. I did not had a chance to respond to your email yet.

You may want to look at the &lt;a href="http://hc.apache.org/httpclient-3.x/sslguide.html" rel="nofollow"&gt;SSL Guide&lt;/a&gt; for Commons HTTP Client. You need to configure the HttpClient from RestTemplate with an SSLSocketFactory.

HTH,
Arul</description>
		<content:encoded><![CDATA[<p>Hi Fray,</p>
<p>I did receive your email. I did not had a chance to respond to your email yet.</p>
<p>You may want to look at the <a href="http://hc.apache.org/httpclient-3.x/sslguide.html" rel="nofollow">SSL Guide</a> for Commons HTTP Client. You need to configure the HttpClient from RestTemplate with an SSLSocketFactory.</p>
<p>HTH,<br />
Arul</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fray</title>
		<link>http://aruld.info/resttemplate-the-spring-way-of-accessing-restful-services/#comment-3913</link>
		<author>Fray</author>
		<pubDate>Wed, 16 Sep 2009 13:39:27 +0000</pubDate>
		<guid>http://aruld.info/resttemplate-the-spring-way-of-accessing-restful-services/#comment-3913</guid>
		<description>Hi again,
Thnks for your help. I have email you via the Contact me, not sure if you got it.
I have following your blog sample, how would you handle like passing all the cert key information including password, truststore, keystore more likely doing the SSL info using RestTemplate.

If you got any ideas, please help.</description>
		<content:encoded><![CDATA[<p>Hi again,<br />
Thnks for your help. I have email you via the Contact me, not sure if you got it.<br />
I have following your blog sample, how would you handle like passing all the cert key information including password, truststore, keystore more likely doing the SSL info using RestTemplate.</p>
<p>If you got any ideas, please help.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arul</title>
		<link>http://aruld.info/resttemplate-the-spring-way-of-accessing-restful-services/#comment-3912</link>
		<author>Arul</author>
		<pubDate>Tue, 15 Sep 2009 03:58:22 +0000</pubDate>
		<guid>http://aruld.info/resttemplate-the-spring-way-of-accessing-restful-services/#comment-3912</guid>
		<description>Hi Fray,

Yes, you would require commons-httpclient-3.1.jar for creating HTTP requests with basic auth. 

The following code would set the credentials for your requests (refer to the TwitterClient constructor) :
CommonsClientHttpRequestFactory factory = (CommonsClientHttpRequestFactory) restTemplate.getRequestFactory(); 
HttpClient client = factory.getHttpClient(); 
client.getState().setCredentials(AuthScope.ANY, credentials);

You need to inject a 'httpClientFactory' to the RestTemplate, in this case the client factory is backed by Commons HTTP Client.

Let me know if this helps.

Cheers,
-Arul</description>
		<content:encoded><![CDATA[<p>Hi Fray,</p>
<p>Yes, you would require commons-httpclient-3.1.jar for creating HTTP requests with basic auth. </p>
<p>The following code would set the credentials for your requests (refer to the TwitterClient constructor) :<br />
CommonsClientHttpRequestFactory factory = (CommonsClientHttpRequestFactory) restTemplate.getRequestFactory();<br />
HttpClient client = factory.getHttpClient();<br />
client.getState().setCredentials(AuthScope.ANY, credentials);</p>
<p>You need to inject a &#8216;httpClientFactory&#8217; to the RestTemplate, in this case the client factory is backed by Commons HTTP Client.</p>
<p>Let me know if this helps.</p>
<p>Cheers,<br />
-Arul</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fray</title>
		<link>http://aruld.info/resttemplate-the-spring-way-of-accessing-restful-services/#comment-3911</link>
		<author>Fray</author>
		<pubDate>Mon, 14 Sep 2009 15:30:18 +0000</pubDate>
		<guid>http://aruld.info/resttemplate-the-spring-way-of-accessing-restful-services/#comment-3911</guid>
		<description>Thank Arul for your direction. I follow your blog, My question is :

1. Do I need to have the commons-httpclient.jar from org.apache.commons.httpclient in order to pass in the user/password?

snippet from my applicationcontext.xml

 class="...RestTemplate"&#62;



In my service
public class MyService implements MyServiceI {
 private RestTemplate restTemplate;

 public String getData(String url,String id) {
  
  return getRestTemplate.getForObject(url,String.class,id);
----&#62; so what do I do here in order to pass in the authentication info.
 }
  
 getter/setter for RESTtemplate
}

Very much thank you.
Regards

Fray</description>
		<content:encoded><![CDATA[<p>Thank Arul for your direction. I follow your blog, My question is :</p>
<p>1. Do I need to have the commons-httpclient.jar from org.apache.commons.httpclient in order to pass in the user/password?</p>
<p>snippet from my applicationcontext.xml</p>
<p> class=&#8221;&#8230;RestTemplate&#8221;&gt;</p>
<p>In my service<br />
public class MyService implements MyServiceI {<br />
 private RestTemplate restTemplate;</p>
<p> public String getData(String url,String id) {</p>
<p>  return getRestTemplate.getForObject(url,String.class,id);<br />
&#8212;-&gt; so what do I do here in order to pass in the authentication info.<br />
 }</p>
<p> getter/setter for RESTtemplate<br />
}</p>
<p>Very much thank you.<br />
Regards</p>
<p>Fray</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arul</title>
		<link>http://aruld.info/resttemplate-the-spring-way-of-accessing-restful-services/#comment-3909</link>
		<author>Arul</author>
		<pubDate>Sun, 13 Sep 2009 05:08:32 +0000</pubDate>
		<guid>http://aruld.info/resttemplate-the-spring-way-of-accessing-restful-services/#comment-3909</guid>
		<description>Hi Fray,

The ClientHttpRequestFactory allows users to plugin either standard J2SE based facility for creating HTTP requests or using CommonsClient APIs. The SimpleClientHttpRequestFactory is very primitive when compared to the comprehensive CommonsClient backed CommonsClientHttpRequestFactory. If you need to perform authentication with your Restful resources, then you may want to use RestTemplate backed by CommonsClient.

Please refer to the Spring configuration in the blog entry which does the magic of wiring HttpClient with RestTemplate using the ClientHttpRequestFactory. The credentials are configured as a bean in Spring config. 

Let me know if you have any specific questions.

HTH,
Arul</description>
		<content:encoded><![CDATA[<p>Hi Fray,</p>
<p>The ClientHttpRequestFactory allows users to plugin either standard J2SE based facility for creating HTTP requests or using CommonsClient APIs. The SimpleClientHttpRequestFactory is very primitive when compared to the comprehensive CommonsClient backed CommonsClientHttpRequestFactory. If you need to perform authentication with your Restful resources, then you may want to use RestTemplate backed by CommonsClient.</p>
<p>Please refer to the Spring configuration in the blog entry which does the magic of wiring HttpClient with RestTemplate using the ClientHttpRequestFactory. The credentials are configured as a bean in Spring config. </p>
<p>Let me know if you have any specific questions.</p>
<p>HTH,<br />
Arul</p>
]]></content:encoded>
	</item>
</channel>
</rss>
