<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>handy &#187; webservice</title>
	<atom:link href="http://sirinsevinc.wordpress.com/category/webservice/feed/" rel="self" type="application/rss+xml" />
	<link>http://sirinsevinc.wordpress.com</link>
	<description>java,webservice,javascript,software algorithms</description>
	<lastBuildDate>Mon, 20 Jul 2009 14:24:24 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='sirinsevinc.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/22dbbb1103eab00233fa34b9029d78b4?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>handy &#187; webservice</title>
		<link>http://sirinsevinc.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://sirinsevinc.wordpress.com/osd.xml" title="handy" />
		<item>
		<title>Spring MVC and Restlet Integration</title>
		<link>http://sirinsevinc.wordpress.com/2008/08/29/spring-mvc-and-restlet-integration/</link>
		<comments>http://sirinsevinc.wordpress.com/2008/08/29/spring-mvc-and-restlet-integration/#comments</comments>
		<pubDate>Fri, 29 Aug 2008 15:58:42 +0000</pubDate>
		<dc:creator>sirin sevinc</dc:creator>
				<category><![CDATA[spring-mvc]]></category>
		<category><![CDATA[webservice]]></category>
		<category><![CDATA[Restlet]]></category>

		<guid isPermaLink="false">http://sirinsevinc.wordpress.com/?p=51</guid>
		<description><![CDATA[The first thing needs to be done is adding RestletFrameworkServlet to web.xml as follows :


    &#60;context-param&#62;
        &#60;param-name&#62;contextConfigLocation&#60;/param-name&#62;
        &#60;param-value&#62;
            classpath:applicationContext-business.xml
        &#60;/param-value&#62;
 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sirinsevinc.wordpress.com&blog=2562058&post=51&subd=sirinsevinc&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>The first thing needs to be done is adding RestletFrameworkServlet to web.xml as follows :</p>
<div style="background-color:#f5f5f5;">
<pre style="font-size:8pt;">
    &lt;context-param&gt;
        &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
        &lt;param-value&gt;
            classpath:applicationContext-business.xml
        &lt;/param-value&gt;
    &lt;/context-param&gt;

    &lt;!-- Loads the root application context of this web app at startup --&gt;
    &lt;listener&gt;
       &lt;listener-class&gt;
              org.springframework.web.context.ContextLoaderListener
       &lt;/listener-class&gt;
   &lt;/listener&gt;

<strong>
    &lt;!-- Spring Dispatcher Servlet which handles http requests
          and invokes the appropriate controller --&gt;</strong>
   &lt;servlet&gt;
        &lt;servlet-name&gt;springrest&lt;/servlet-name&gt;
        &lt;servlet-class&gt;
                  org.springframework.web.servlet.DispatcherServlet
        &lt;/servlet-class&gt;
        &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
    &lt;/servlet&gt;
    &lt;servlet-mapping&gt;
        &lt;servlet-name&gt;springrest&lt;/servlet-name&gt;
        &lt;url-pattern&gt;*.html&lt;/url-pattern&gt;
    &lt;/servlet-mapping&gt;

<strong>
    &lt;!-- Restlet adapter --&gt;
    &lt;servlet&gt;
        &lt;servlet-name&gt;rservlet&lt;/servlet-name&gt;
        &lt;servlet-class&gt;
             com.noelios.restlet.ext.spring.RestletFrameworkServlet
        &lt;/servlet-class&gt;
        &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
    &lt;/servlet&gt;

    &lt;!-- Catch all request URIs starting with  prefix /rest--&gt;
    &lt;servlet-mapping&gt;
        &lt;servlet-name&gt;rservlet&lt;/servlet-name&gt;
        &lt;url-pattern&gt;/rest/*&lt;/url-pattern&gt;
    &lt;/servlet-mapping&gt;
</strong></pre>
</div>
<p>RestletFrameworkServlet extends from FrameworkServlet which is basically created to provide integration with Spring application context. Therefore for the requests ending with .html suffix are handled by Dispatcher Servlet and the requests starting with the prefix /rest are handled by RestletFrameworkServlet. Service definitions for the business logic are kept in applicationContext.business.xml file which is loaded at the startup of the application and all the bean definitions in this file are accessible from both Spring controllers and Restlet resources.</p>
<p>The next should be done is creating the rservlet-servlet.xml file which will contain restlets and resources in it.This file is parsed by RestletFrameworkServlet.</p>
<div style="background-color:#f5f5f5;overflow:auto;">
<pre style="font-size:8pt;">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"&gt;

	&lt;bean id="root" class="org.restlet.ext.spring.SpringRouter"&gt;
        &lt;property name="attachments"&gt;
            &lt;map&gt;
                &lt;entry key="/users/{user}"&gt;
                    &lt;bean class="org.restlet.ext.spring.SpringFinder"&gt;
                        &lt;lookup-method name="createResource" bean="userResource" /&gt;
                    &lt;/bean&gt;
                &lt;/entry&gt;
            &lt;/map&gt;
        &lt;/property&gt;
    &lt;/bean&gt;

    &lt;bean id="userResource" class="net.springrest.user.UserResource" scope="prototype" &gt;
	&lt;!-- userService is a service which is used by both your web controller and rest resource
                and it is defined in applicationContext-business.xml file --&gt;
    	&lt;property name="userService" ref="userService" /&gt;
    &lt;/bean&gt;

&lt;/beans&gt;</pre>
</div>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/sirinsevinc.wordpress.com/51/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/sirinsevinc.wordpress.com/51/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sirinsevinc.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sirinsevinc.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sirinsevinc.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sirinsevinc.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sirinsevinc.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sirinsevinc.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sirinsevinc.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sirinsevinc.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sirinsevinc.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sirinsevinc.wordpress.com/51/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sirinsevinc.wordpress.com&blog=2562058&post=51&subd=sirinsevinc&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://sirinsevinc.wordpress.com/2008/08/29/spring-mvc-and-restlet-integration/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a9d9718257bc3dedcd892134e22b4295?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sirinse</media:title>
		</media:content>
	</item>
		<item>
		<title>SSL and Web Service</title>
		<link>http://sirinsevinc.wordpress.com/2008/02/08/ssl-and-web-service/</link>
		<comments>http://sirinsevinc.wordpress.com/2008/02/08/ssl-and-web-service/#comments</comments>
		<pubDate>Fri, 08 Feb 2008 13:32:00 +0000</pubDate>
		<dc:creator>sirin sevinc</dc:creator>
				<category><![CDATA[webservice]]></category>
		<category><![CDATA[ssl]]></category>
		<category><![CDATA[tomcat]]></category>

		<guid isPermaLink="false">http://sirinsevinc.wordpress.com/2008/02/08/ssl-and-web-service/</guid>
		<description><![CDATA[SOAP doesn&#8217;t deal with whether the connection is SSL or not. This is a HTTP issue,so there is nothing to do in web service implementation to secure the connection.
If a secure connection is needed to establish then there are thing to do. Assume that the web container is Tomcat server then in TOMCAT_HOME/conf/server.xml the connection [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sirinsevinc.wordpress.com&blog=2562058&post=14&subd=sirinsevinc&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>SOAP doesn&#8217;t deal with whether the connection is SSL or not. This is a HTTP issue,so there is nothing to do in web service implementation to secure the connection.<br />
If a secure connection is needed to establish then there are thing to do. Assume that the web container is Tomcat server then in TOMCAT_HOME/conf/server.xml the connection attibute has to be uptaded to ensure that Tomcat server accepts ssl connection requests.<br />
After that, the certificate has to be loaded to the client, to achieve this, <b>keytool</b> command is used<br />
keytool  -import -trustcacerts -alias FOO -file &#8220;FOO_PATH\foo.cer&#8221;  -storetype JKS -keystore &#8220;FOO_PATH\foo.keystore&#8221;<br />
Secondly the code below has to be added to just before getting connetion to the server.</p>
<div style="background-color:rgb(245, 245, 245);"><code style="font-size:9pt;"><br />
System.setProperty("javax.net.ssl.keyStore", "FOO_PATH/foo.keystore");<br />
System.setProperty("javax.net.ssl.keyStorePassword","changeit");<br />
System.setProperty("javax.net.ssl.keyStoreType","JKS");<br />
System.setProperty("javax.net.ssl.trustStore", "FOO_PATH/foo.keystore");<br />
System.setProperty("javax.net.ssl.trustStorePassword", "changeit");<br />
System.setProperty("java.protocol.handler.pkgs","com.sun.net.ssl.internal.www.protocol");<br />
Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());<br />
</code></div>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/sirinsevinc.wordpress.com/14/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/sirinsevinc.wordpress.com/14/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sirinsevinc.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sirinsevinc.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sirinsevinc.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sirinsevinc.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sirinsevinc.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sirinsevinc.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sirinsevinc.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sirinsevinc.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sirinsevinc.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sirinsevinc.wordpress.com/14/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sirinsevinc.wordpress.com&blog=2562058&post=14&subd=sirinsevinc&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://sirinsevinc.wordpress.com/2008/02/08/ssl-and-web-service/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a9d9718257bc3dedcd892134e22b4295?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sirinse</media:title>
		</media:content>
	</item>
	</channel>
</rss>