<?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>Dummy @ work</title>
	<atom:link href="http://dummyatwork.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://dummyatwork.wordpress.com</link>
	<description>Rants and pains in software (with contributors)</description>
	<lastBuildDate>Mon, 03 May 2010 09:23:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='dummyatwork.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/64f03ff946f050829e584772c77fdaa3?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Dummy @ work</title>
		<link>http://dummyatwork.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://dummyatwork.wordpress.com/osd.xml" title="Dummy @ work" />
	<atom:link rel='hub' href='http://dummyatwork.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Interface vs. abstract class</title>
		<link>http://dummyatwork.wordpress.com/2010/05/03/interface-vs-abstract-class/</link>
		<comments>http://dummyatwork.wordpress.com/2010/05/03/interface-vs-abstract-class/#comments</comments>
		<pubDate>Mon, 03 May 2010 09:23:23 +0000</pubDate>
		<dc:creator>deroude</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://dummyatwork.wordpress.com/?p=36</guid>
		<description><![CDATA[I had a casual phone interview last week, over a job I didn&#8217;t know I had applied for (thanks to my job search engines, probably).  The technical guy at the other end of the phone call asked me a few noob Java questions, to which I replied more or less amused, but definitely not seriously [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dummyatwork.wordpress.com&amp;blog=5985640&amp;post=36&amp;subd=dummyatwork&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I had a casual phone interview last week, over a job I didn&#8217;t know I had applied for (thanks to my job search engines, probably).  The technical guy at the other end of the phone call asked me a few noob Java questions, to which I replied more or less amused, but definitely not seriously &#8211; due to my huge ego, the after-lunch full stomach mood and my epic resentfulness of phone conversations where something it as stake (more to the latter <img src='http://s2.wp.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> ). One of the questions was &#8220;what is the difference between a Java interface and an abstract class?&#8221; That got me.</p>
<p>Since then. I&#8217;ve been talking to people, trying to find an answer: why did the Java guys create interfaces? (If my phD professor sees this, he might squish me like the ignorant fly that I am, but I beseech him to first answer at length).</p>
<p>To put everyone&#8217;s mind at ease in my work department, <strong>I do know my Java</strong>. I know the grammar and semantics and the parts I don&#8217;t know (because I try hard to keep the details safely OUT of my mind) &#8211; I know quite well where to find. <strong> </strong></p>
<p><strong><span style="font-weight:normal;">But in the end &#8211; what is the difference? In effect, why is the interface necessary? </span></strong></p>
<ul>
<li><strong><span style="font-weight:normal;">Is it because one can extend only one abstract class (but implement more interfaces)? Okay, but why is that? An &#8220;extension&#8221; is a manifestation of an &#8220;is-a&#8221; relationship. So, why can a certain class &#8220;be-a&#8221; just one parent semantic?That is, if a &#8220;dog&#8221; &#8220;is-a&#8221; &#8220;mammal&#8221;, than how can I also make it a &#8220;pet&#8221; &#8211; since the classes are unrelated but seriously, they are not interfaces.</span></strong></li>
<li><strong><span style="font-weight:normal;"> Interfaces do not implement methods and do not have a class &#8220;individuality&#8221; that can be grabbed when inherited. So, interfaces are sub-notions of abstract classes. Are they?</span></strong></li>
<li><strong><span style="font-weight:normal;">A very interesting phrase a friend of mine sent me via google: &#8211; &#8220;Interfaces can be implemented by classes that are not related to one another&#8221;. That is, as opposed to what? If there was an ontological relationship between direct extending classes of an abstract class, then the inheritance wouldn&#8217;t be direct any more. But I do admit some significance in this phrase &#8211; it probably relates to the &#8220;class facets&#8221; paradigm. You see interfaces as public utilities &#8211; so my question is: are they compiled differently from abstract classes? Do they simplify the resulting binary, make it faster? </span></strong></li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dummyatwork.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dummyatwork.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dummyatwork.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dummyatwork.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dummyatwork.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dummyatwork.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dummyatwork.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dummyatwork.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dummyatwork.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dummyatwork.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dummyatwork.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dummyatwork.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dummyatwork.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dummyatwork.wordpress.com/36/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dummyatwork.wordpress.com&amp;blog=5985640&amp;post=36&amp;subd=dummyatwork&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dummyatwork.wordpress.com/2010/05/03/interface-vs-abstract-class/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3c72d319d4dbcc7f3d5bb5e613bac1c1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">deroude</media:title>
		</media:content>
	</item>
		<item>
		<title>WSDL Proxy &#8211; Making your WSDL application Ajax-portable</title>
		<link>http://dummyatwork.wordpress.com/2009/01/06/wsdl-proxy-making-your-wsdl-application-ajax-portable/</link>
		<comments>http://dummyatwork.wordpress.com/2009/01/06/wsdl-proxy-making-your-wsdl-application-ajax-portable/#comments</comments>
		<pubDate>Tue, 06 Jan 2009 10:50:22 +0000</pubDate>
		<dc:creator>deroude</dc:creator>
				<category><![CDATA[Web Services]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[wsdl]]></category>

		<guid isPermaLink="false">http://dummyatwork.wordpress.com/?p=28</guid>
		<description><![CDATA[Ok, so you want to access a WSDL source and consume it in your web application, using Javascript. With a very nice Javascript SOAP Client available, everything looks peachy, safe and well documented. Except it uses Ajax, and inherently XHR (XML HTTP Request), which cannot reach cross domain. That&#8217;s a bugger, of course, because the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dummyatwork.wordpress.com&amp;blog=5985640&amp;post=28&amp;subd=dummyatwork&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Ok, so you want to access a WSDL source and consume it in your web application, using Javascript. With a very nice <a href="http://www.codeplex.com/JavaScriptSoapClient" target="_blank">Javascript SOAP Client</a> available, everything looks peachy, safe and well documented. Except it uses Ajax, and inherently XHR (XML HTTP Request), which cannot reach cross domain. That&#8217;s a bugger, of course, because the whole point of WSDL and Web Services in general is to be available to any number of consumers far and wide, from granny to Mars. So, how do we deal with that?<br />
<span id="more-28"></span><br />
One solution is to have PHP retrieve the results and pass them into Javascript in a simple, unparsed (or custom parsed) form, then interepret them in Javascript &#8211; meaning of course we cannot use the nice Javascript SOAP Client, or SOAP in general, and we are back to Stone Age, passing string messages and praying they don&#8217;t have any demonizing special characters in them.<br />
Another possible solution would be to have a PHP proxy WSDL, that takes the target Service <em>url</em>, required <em>method</em> and <em>parameters</em> as its own parameters, retrieves the results and passes them back to whoever needs them. You can use <a href="http://sourceforge.net/projects/nusoap/" target="_blank">NuSOAP</a>, as well as some well directed pointers from <a href="http://www.scottnichol.com/nusoapprogwsdl.htm" target="_blank">Scott Nichol</a> and the <a href="http://www.wackylabs.net/2004/07/creating-a-web-service-and-wsdl-using-nusoap/" target="_blank">Wacky Labs</a>, to whom I&#8217;d like to extend my warm thanks.<br />
Having concentrated on this solution, here is the proxy code:<br />
<pre class="brush: php;">
&lt;?php
require_once('lib/nusoap.php');
$server=new soap_server;
$server-&gt;configureWSDL('proxywsdl', 'urn:proxywsdl');

$server-&gt;wsdl-&gt;addComplexType(
  'results',
  'complexType', 
  'array', 
  '', 
  'SOAP-ENC:Array', 
  array(),
  array(
    array('ref' =&gt; 'SOAP-ENC:arrayType', 
         'wsdl:arrayType' =&gt; 'xsd:string[]')
  ),
  'xsd:string'
);

$server-&gt;register('proxy',                // method name
    array('url' =&gt; 'xsd:string','method'=&gt;'xsd:string','params'=&gt;'xsd:string'),        // input parameters
    array('result' =&gt; 'tns:results'),      // output parameters
    'urn:proxywsdl',                      // namespace
    'urn:proxywsdl#proxy',                // soapaction
    'rpc',                                // style
    'encoded',                            // use
    'Wraps and resends a wsdl package from an outside source - good for use with a localhost service client needing Ajax / XHR'            // documentation
);


function proxy($url,$method,$params) 
{
    $client = new soapclient($url, true);
    $err = $client-&gt;getError();
    if ($err) {
      return &quot;Cannot connect to URL&quot;;
    }
    $result = $client-&gt;call($method,make_array($params));
    if ($client-&gt;fault) {
      return &quot;Web service unavailable&quot;;
    } 
    else {
      $err = $client-&gt;getError();
      if ($err) {
          return $err;          
      } 
      else {
          return $result;
      }
    }
}

function make_array($p)
{
  $ret=array();
  $raw=split(',',$p);
  foreach ($raw as $par)
  {
    $unit=split(':',$par);
    $ret[$unit[0]]=$unit[1];
  }
  return $ret;
}

$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
$server-&gt;service($HTTP_RAW_POST_DATA);
?&gt;
</pre></p>
<p>And this is how you call it from an application (in PHP, but you can use javascript now, of course):</p>
<p><pre class="brush: php;">
client-&gt;call('proxy',array('url'=&gt;'https://127.0.0.1:8443/testWS/wsdl/wsSource.wsdl','method'=&gt;'testDB','params'=&gt;'name:cf_2009'));
</pre></p>
<p>The immediate rant I would have is that the parameters are passed to the proxy as a string, of the form:</p>
<blockquote><p>param_name1:param_value1,param_name2:param_value2</p></blockquote>
<p>which is not elegant and could lead to trouble, since there you don&#8217;t have a native way to check (and catch) validity errors. You can do that manually of course, in the <em>make_array</em> function. A second issue is that you cannot pass complex type parameters (but that is a rather rare occurence anyway).<br />
The trouble is, at the point where you register the <em>proxy</em> Service, you have no idea of the types and count of parameters you will receive, so you cannot dynamically modify it (and it would be utterly unhealthy to do that, as well). Think of it as similar to the way you pass parameters via GET to a PHP page <img src='http://s2.wp.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' />  . TODO &#8211; a workaround this.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dummyatwork.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dummyatwork.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dummyatwork.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dummyatwork.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dummyatwork.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dummyatwork.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dummyatwork.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dummyatwork.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dummyatwork.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dummyatwork.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dummyatwork.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dummyatwork.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dummyatwork.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dummyatwork.wordpress.com/28/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dummyatwork.wordpress.com&amp;blog=5985640&amp;post=28&amp;subd=dummyatwork&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dummyatwork.wordpress.com/2009/01/06/wsdl-proxy-making-your-wsdl-application-ajax-portable/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3c72d319d4dbcc7f3d5bb5e613bac1c1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">deroude</media:title>
		</media:content>
	</item>
		<item>
		<title>WSDL Web Service querying a DB (Eclipse w/ client in PHP)</title>
		<link>http://dummyatwork.wordpress.com/2008/12/29/hello-world/</link>
		<comments>http://dummyatwork.wordpress.com/2008/12/29/hello-world/#comments</comments>
		<pubDate>Mon, 29 Dec 2008 09:56:42 +0000</pubDate>
		<dc:creator>deroude</dc:creator>
				<category><![CDATA[Web Services]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[ssl]]></category>
		<category><![CDATA[web service]]></category>
		<category><![CDATA[wsdl]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Prologue: I started out as your average guy with solid knowledge in WSDL and web services, to test out and build a minimal database connected service in Eclipse, and consume it in a web application somewhere else (anywhere else to be more specific, that is to make the data source available to any number of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dummyatwork.wordpress.com&amp;blog=5985640&amp;post=1&amp;subd=dummyatwork&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>Prologue:</strong> I started out as your average guy with solid knowledge in WSDL and web services, to test out and build a minimal database connected service in Eclipse, and consume it in a web application somewhere else (anywhere else to be more specific, that is to make the data source available to any number of web servers having our application installed). And the reason I wrote this article is that I&#8217;ve had about three hours of &#8220;feeling dumb&#8221; penitence doing just that.<br />
<span id="more-1"></span><br />
<strong>Prerequisites:</strong> Eclipse 3.0 (I use the BIRT reporting bundle &#8211; get it <a href="http://www.eclipse.org/downloads/" target="_blank">here</a>); Apache Tomcat 6.0 (get it <a href="http://tomcat.apache.org/download-60.cgi" target="_blank">here</a>); mySQL 5 or latest (get it <a href="http://dev.mysql.com/downloads/mysql/5.0.html" target="_blank">here</a>); mySQL connector for Java 5.1 (get it <a href="http://dev.mysql.com/downloads/connector/j/5.1.html" target="_blank">here</a>) &#8211; and for testing: NuSOAP (get it <a href="http://sourceforge.net/projects/nusoap/" target="_blank">here</a>); any web server supporting PHP 5 (I use wamp &#8211; get it <a href="http://www.wampserver.com/en/download.php" target="_blank">here</a>).</p>
<p><strong>The Service:</strong> This is fairly easy &#8211; here are the steps (assuming everything is installed and ready &#8211; namely Tomcat, MySQL and the PHP enabled web server):</p>
<ul>
<li>Start Eclipse, choose the Java EE Perspective.</li>
<li>Menu&gt;New&gt;Dynamic Web Project
<li>Right Click on the project title in the Project Explorer and New&gt;Other&gt;Java&gt;Class. This is the service source, containing all the methods that will be exposed by the service. Here is some sample code:</li>
</ul>
<p><pre class="brush: java;">
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
		
public class wsSource {
	public String testDB(String name)
	{
		String ret=&quot;No DB response&quot;;
		Connection conn = null;
		String url = &quot;jdbc:mysql://localhost:3306/&quot;;
		String dbName = &quot;yourDataBase&quot;;
		String driver = &quot;com.mysql.jdbc.Driver&quot;;
		String userName = &quot;root&quot;; 
		String password = &quot;&quot;;
		    try {
		      Class.forName(driver).newInstance();
		      conn = DriverManager.getConnection(url+dbName,userName,password);
		      ret=&quot;No result&quot;;
		      Statement statement = conn.createStatement();	 
		      ResultSet resultSet = statement.executeQuery (&quot;select author from templates where template_name='&quot;+name+&quot;'&quot;);
		      if(resultSet.next()) ret=resultSet.getString(1);
		      conn.close();
		    } catch (Exception e){ret=e.toString();}
			return ret;
		}
}
</pre></p>
<ul>
<li>After your class is written, right click on it, Web Services&gt;Create Web Service, fill the gauge on the Service picture, leave the Client empty and Next until it is generated. Use the Web Service Explorer to test your newly created WSDL file (which can be found in <em>yourProject/WebContent/wsdl/</em>). Double click on it to open it in the nice WSDL Editor, for which you can get a tutorial <a href="http://wiki.eclipse.org/index.php/Introduction_to_the_WSDL_Editor" target="_blank">here</a>.</li>
<li>Export your project to a WAR file in your Tomcat server&#8217;s webapps folder.</li>
<li><font color="red"><strong>Attention!!</strong></font> The mysql driver (or any other DB driver) jar which contains the class invoked here (i.e. &#8216;com.mysql.jdbc.Driver&#8217;) must be present in the Tomcat lib folder, or you will get a &#8220;java.lang.ClassNotFoundException: com.mysql.jdbc.Driver&#8221; exception. (this accounted for an hour of hair pulling on my side <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> ) )</li>
</ul>
<p>OK, that much for the web service part.</p>
<p><strong>The Client:</strong> You can, of course, auto-generate a client in Eclipse, by simply filling up the Client gauge in the wizard you just used (or creating a separate Dynamic Web Project that consumes the service you have just created). But the interesting point in web services is that they are &#8220;cross-&#8221; a lot of things (e.g. platform, technology, language, political opinion, religion, etc. but keep in mind the first two <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> ) ). So, I have chosen to use PHP. And here are the steps:</p>
<ul>
<li>Create a folder in your &#8220;www&#8221; root and copy the NuSOAP files that you have downloaded there (unarchived, doh&#8230;)</li>
<li>Create a new PHP file to test your web service &#8211; like this:</li>
</ul>
<p><pre class="brush: php;">
getError();
if ($err) {
    echo '&lt;h2&gt;Constructor error&lt;/h2&gt;&lt;pre&gt;' . $err . '&lt;/pre&gt;';
}
//call the method you want from the web service; if it takes parameters, input them as an associative array
$result = $client-&gt;call('testDB',array('name' =&gt; 'budget_2008'));

if ($client-&gt;fault) {
    echo '&lt;h2&gt;Fault&lt;/h2&gt;&lt;pre&gt;';
    print_r($result);
    echo '&lt;/pre&gt;';
} else {
    $err = $client-&gt;getError();
    if ($err) {
        echo '&lt;h2&gt;Error&lt;/h2&gt;&lt;pre&gt;' . $err . '&lt;/pre&gt;';
    } else {
        echo '&lt;h2&gt;Result&lt;/h2&gt;&lt;pre&gt;';
        print_r($result);
    echo '&lt;/pre&gt;';
    }
}
</pre><br />
And without further ado, start the web server and test your service. Voila!</p>
<p><strong>Security</strong>. It seems that NuSOAP does not support WS-Security implementation (but I may be wrong, as time goes by <img src='http://s0.wp.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  &#8211; my <a href="http://osdir.com/ml/php.nusoap.general/2005-05/msg00047.html" target="_blank">info source</a> is a bit old. Therefore I&#8217;ll just concentrate on SSL for the moment.<br />
There are two places you would want to secure &#8211; the application dealing with the public and the web service server. Depending on who you trust and on the architecture, you might choose to secure both or just one. For instance, if the web service can be consumed by any web site freely, then you must allow access to any web site and therefore you must secure that access (and it&#8217;s their business how they secure public access to their application). If the web service and the application consuming it are both yours, and it is just a matter of distributing various servers geographically, then you can restrict access to the web service to just a number of hosts, which makes it less interesting to actually add SSL to the web service &#8211; instead, you should just concentrate on securing the side which is open to the web public.<br />
To do that, a good practical way is to add SSL to your web server.<br />
For the Tomcat server (web service server) I found a great walkthrough <a href="http://techtracer.com/2007/09/12/setting-up-ssl-on-tomcat-in-3-easy-steps/" target="_blank">here</a>. In addition to that, you will need to specify the algorithm as RSA, otherwise Firefox 3 will not let you in, as per <a href="http://thicksliced.blogspot.com/2008/09/error-secerrorbadsignature-with-firefox.html" target="_blank">this</a> description. To sum up, what you need to write in the command line to create a key looks like:</p>
<blockquote><p>keytool -genkey -alias myalias -keypass mypass -keystore mykey.bin -storepass mypass -keyalg rsa</p></blockquote>
<p>For Wamp, things got a bit more complicated. I spent about an hour tinkering with httpd.conf and httpd-ssl.conf, until I gave up and found the correct directions <a href="http://www.wampserver.com/phorum/read.php?2,28731,page=1" target="_blank">here</a>.<br />
<font color="red"><strong>Attention!</strong></font> Both for the Java keytool and the OpenSSL, when you create the key, at the &#8220;Last name / first name&#8221; or respectively &#8220;Common Name&#8221; prompt input the host name that will be used right after &#8220;https://&#8221; &#8211; e.g. &#8220;www.mydomain.com&#8221;. Anything else will result in a security error saying that the certificate domain does not match the host domain. If you are using <em>localhost</em>, do not input &#8220;localhost&#8221; at the &#8220;Common Name&#8221; prompt, instead use &#8220;127.0.0.1&#8243;, otherwise you will get a bug error in Firefox 3, as it is gracefully explained <a href="http://adamnoffie.blogspot.com/2008/07/firefox-3-and-self-signed-ssl.html" target="_blank">here</a>. You will still need to add a security exception in any browser, because the certificate is self signed, instead of being signed by an authority.<br />
Once the domain is made public, you can get a signature from a certification authority, in order to avoid the nuisance of having to confirm / add exceptions on each new machine or web browser.<br />
Note: If you want to use IIS for the whole architecture, you can find an article <a href="http://support.microsoft.com/kb/307267" target="_blank">here</a>, describing just how to get the security issue done.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dummyatwork.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dummyatwork.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dummyatwork.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dummyatwork.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dummyatwork.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dummyatwork.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dummyatwork.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dummyatwork.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dummyatwork.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dummyatwork.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dummyatwork.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dummyatwork.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dummyatwork.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dummyatwork.wordpress.com/1/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dummyatwork.wordpress.com&amp;blog=5985640&amp;post=1&amp;subd=dummyatwork&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dummyatwork.wordpress.com/2008/12/29/hello-world/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3c72d319d4dbcc7f3d5bb5e613bac1c1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">deroude</media:title>
		</media:content>
	</item>
	</channel>
</rss>
