<?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:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Rant in C#</title>
	<atom:link href="http://rantincsharp.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://rantincsharp.wordpress.com</link>
	<description>...whilst sipping on Java</description>
	<lastBuildDate>Wed, 24 Jun 2009 16:03:48 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='rantincsharp.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/ee3ef733fe67b74886800b4463525cc3?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Rant in C#</title>
		<link>http://rantincsharp.wordpress.com</link>
	</image>
			<item>
		<title>Basics of HTTP</title>
		<link>http://rantincsharp.wordpress.com/2009/06/24/basics-of-http/</link>
		<comments>http://rantincsharp.wordpress.com/2009/06/24/basics-of-http/#comments</comments>
		<pubDate>Wed, 24 Jun 2009 16:03:48 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[rest]]></category>
		<category><![CDATA[web-services]]></category>

		<guid isPermaLink="false">http://rantincsharp.wordpress.com/?p=116</guid>
		<description><![CDATA[This is a refresher about the HTTP protocol (citation: RESTful Web Services, 2007, L.Richardson, S. Ruby, O&#8217;Rielly Media Inc).
What is HTTP?
HTTP stands for Hypertext Transfer Protocol.
Using the analogy of a document and envelope&#8230;
HTTP is a document based protocol:

A client puts a document into an envelope and sends to a server.
The sever puts a response envelope [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rantincsharp.wordpress.com&blog=3622497&post=116&subd=rantincsharp&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>This is a refresher about the HTTP protocol (citation: RESTful Web Services, 2007, L.Richardson, S. Ruby, O&#8217;Rielly Media Inc).</p>
<h1>What is HTTP?</h1>
<p>HTTP stands for Hypertext Transfer Protocol.</p>
<p>Using the analogy of a document and envelope&#8230;</p>
<p>HTTP is a document based protocol:</p>
<ol>
<li>A client puts a document into an envelope and sends to a server.</li>
<li>The sever puts a response envelope into an envelope and sends to the client.</li>
</ol>
<p>HTTP has strict standards about the type of envelope but not what goes inside it.</p>
<h1><span style="color:#008000;">HTTP Request (Client)<br />
</span></h1>
<h2>The HTTP Method</h2>
<p>Can be GET, POST, DELETE, PUT, OPTIONS, HEAD, PROFIND, COPY, MOVE</p>
<h2>The Path</h2>
<p>The URI to the right of the hostname &#8211; this becomes the address on the envelope.</p>
<h2>Request Headers</h2>
<p>These are key-value pairs that specify infomation about the envelope &#8211; there are 46 in all &#8211; some of them include: Host, User-Agent, Accept, Keep-Alive&#8230;</p>
<h2>The Entity Body/Document/Representation</h2>
<p>The document inside the envelope.  GET requests never have an entity body, all the information necessary is included in the path and request header.</p>
<p>In POST requests &#8211; the entity body could be structured XML to pass over a substantial amount of complex data.  Some web services may take this data and make objects from the XML and feed it into a database, however you do not necesarily have to use XML you can just use plain text, you also don&#8217;t have to put the data in a database &#8211; you can do what you want with data once you recieve it on the database.</p>
<p>The following shows an example of a GET reqeust to the BBC:</p>
<p>(Request-Line)    GET / HTTP/1.1<br />
Host    www.bbc.co.uk<br />
User-Agent    Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.11) Gecko/2009060215 Firefox/3.0.11<br />
Accept    text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8<br />
Accept-Language    en-gb,en;q=0.5<br />
Accept-Encoding    gzip,deflate<br />
Accept-Charset    ISO-8859-1,utf-8;q=0.7,*;q=0.7<br />
Keep-Alive    300<br />
Proxy-Connection    keep-alive<br />
Cookie    AMOS_PREF=sac%3Dg4; BBC-UID=e4c73e81d4fc55653460b7caa03036f31b6ba10990a0b114b4ffb881cf0ba6450Mozilla%2f5%2e0%20%28Windows%3b%20U%3b%20Windows%20NT%205%2e1%3b%20en%2dGB%3b%20rv%3a1%2e8%2e1%2e12%29%20Gecko%2f20080201%20Firefox%2f2%2e0%2e0%2e12; BBCNewsAudience=Domestic; BBCNewsAudcWght=-99; BBCMediaSelector=m%3Arm&amp;b%3Abb&amp;st%3Ah&amp;ms3%3A4; hp=+acv+ba+neaj+hj+oab*+c1+g1ab+mc2+rad*+da+f1a7b7c7d7+i+kca+la</p>
<h1><span style="color:#993300;">HTTP Response (Server)<br />
</span></h1>
<h2>HTTP Response Codes</h2>
<p>The code tells the client what happened to their request &#8211; did it fail or was success achieved.   There are lots of codes, the most common you will have seen on the web is 404 &#8211; which means &#8220;Not Found&#8221; i.e. the web page was not found on the server.  A success code will usually be 200 i.e. if you got to see the web page you asked for.</p>
<h2>Response Header</h2>
<p>Pretty much the same as Request Headers e.g. Date, Server, Etag, Content-Type, Last-Modified&#8230;</p>
<h2>The Entity Body/Document/Representation</h2>
<p>In GET requests you actually get an entity body sent to you (or at least you should do!)   The Response Header also makes an important contribution here, like <strong>Content-Type</strong> &#8211; this will tell the client about the <strong>media-type </strong>to expect (there are many of these) but in the case of a browser rendering an HTML web page it will commonly be <strong>text/html</strong>.</p>
<p>N.B &#8211; media-type can also be referred to as MIME type, content type or data type.</p>
<p>The following is an example of a response from the BBC:</p>
<p>(Status-Line)    HTTP/1.1 200 OK<br />
Via    1.1 BLADEWIN17<br />
Connection    Keep-Alive<br />
Proxy-Connection    Keep-Alive<br />
Content-Length    110652<br />
Date    Wed, 24 Jun 2009 16:00:01 GMT<br />
Age    87<br />
Content-Type    text/html<br />
Server    Apache<br />
Accept-Ranges    bytes<br />
Keep-Alive    timeout=4, max=194</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rantincsharp.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rantincsharp.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rantincsharp.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rantincsharp.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rantincsharp.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rantincsharp.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rantincsharp.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rantincsharp.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rantincsharp.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rantincsharp.wordpress.com/116/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rantincsharp.wordpress.com&blog=3622497&post=116&subd=rantincsharp&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://rantincsharp.wordpress.com/2009/06/24/basics-of-http/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/959e169893c5d1a7b562c9dbdf750708?s=96&#38;d=identicon" medium="image">
			<media:title type="html">earnshaw</media:title>
		</media:content>
	</item>
		<item>
		<title>Creating a Restful Web Service Part 1</title>
		<link>http://rantincsharp.wordpress.com/2009/05/07/creating-a-restful-web-service-part-1/</link>
		<comments>http://rantincsharp.wordpress.com/2009/05/07/creating-a-restful-web-service-part-1/#comments</comments>
		<pubDate>Thu, 07 May 2009 15:15:42 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[uncategorized]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[rest]]></category>
		<category><![CDATA[restlet]]></category>

		<guid isPermaLink="false">http://rantincsharp.wordpress.com/?p=99</guid>
		<description><![CDATA[Objective: To develop a web service that is to be used internally by applications to retrieve and write data to an Oracle database.
I wanted to develop a web service that was designed with the REST framework in mind, SOAP is just too &#8220;noisy&#8221;, and overly complex.   The web service had to be able connect [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rantincsharp.wordpress.com&blog=3622497&post=99&subd=rantincsharp&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><strong>Objective</strong>: To develop a web service that is to be used internally by applications to retrieve and write data to an Oracle database.</p>
<p>I wanted to develop a web service that was designed with the REST framework in mind, SOAP is just too &#8220;noisy&#8221;, and overly complex.   The web service had to be able connect and interact with an Oracle database, it also had to return any data from the database as XML.  You can view the results directly from a web browser if it&#8217;s XML, but it is not really necessary as a web service is mostly a non-human readable resource.</p>
<p>So, I was developing with Java &#8211; and had to try an work out what the best tools, APIs would be, bearing in mind the myriad of tools out there on the web.  It took quite a while looking at all the various API&#8217;s out there (Spring, Hibernate, iBATIS, EclipseLink, Toplink &#8211; the list goes on), but I chose ones that matched the following criteria:<br />
a) if a technology was already in use at work, then that had to be adopted &#8211; in order to stop a proliferation of different technologies being used, supported and maintained.</p>
<p>b) easy to use and understand.</p>
<p>c) have decent community support behind them &#8211; so if problems arise then at least someone out there may be able to lend a hand.</p>
<p>d) look likely to be well supported in the future without fading into obscurity in the next couple of weeks/months.</p>
<h2>Choosing the Right Tools &#8211; My Software Stack</h2>
<ul>
<li>Java IDE &#8211; is Eclipse Europa v3.3.2</li>
</ul>
<ul>
<li>Apache Tomcat Application Server v5.5.17</li>
</ul>
<ul>
<li>For the REST web service I chose &#8211; <a href="http://www.restlet.org/">Restlet v1.1.4</a>.</li>
</ul>
<p style="padding-left:60px;">A really nice and clean well supported framework.  Some of the tutorials were a bit raw but they have improved of recent and the documentation is getting better all the time.  They are constantly improving the API and stable releases are issued on a resonably regular basis.  They are keen to adopt good standards and it was pleasing to see that WADL is supported in their extended APIs for Restlet.</p>
<ul>
<li>For Object Relational Mapping (ORM) with Oracle I chose <a href="http://download.oracle.com/otn/nt/ias/10131/toplink_101310.zip">Toplink  (version 10g Release 3 10.1.3.3.0) </a>and the Workbench software- don&#8217;t even think about using raw JDBC API&#8217;s &#8211; it&#8217;s much less work to use Toplink rather than code everything from scratch.</li>
</ul>
<ul>
<li>For XML to Object ORM, I chose Sun&#8217;s <a href="https://jaxb.dev.java.net/">JAXB v2.0</a> implemenation &#8211; so, so, so much better than Toplinks crummy efforts (so I am saying Toplink is good for database ORM but not for XML ORM) &#8211; I spent so many wasted development hours on this piece of crud &#8211; so don&#8217;t use it unless you want to a miserable life as a developer.  JAXB is nice, its from Sun so it should conform to some form of standard.  The docs are good and it takes seconds to run the JAXB compiler from a command line along with your XSD schema and generate your Java classes.  Pretty good all round.</li>
</ul>
<p>In my next post I explain how I used the above to create my REST web service.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rantincsharp.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rantincsharp.wordpress.com/99/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rantincsharp.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rantincsharp.wordpress.com/99/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rantincsharp.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rantincsharp.wordpress.com/99/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rantincsharp.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rantincsharp.wordpress.com/99/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rantincsharp.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rantincsharp.wordpress.com/99/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rantincsharp.wordpress.com&blog=3622497&post=99&subd=rantincsharp&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://rantincsharp.wordpress.com/2009/05/07/creating-a-restful-web-service-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/959e169893c5d1a7b562c9dbdf750708?s=96&#38;d=identicon" medium="image">
			<media:title type="html">earnshaw</media:title>
		</media:content>
	</item>
		<item>
		<title>XML Parsers</title>
		<link>http://rantincsharp.wordpress.com/2009/03/11/xml-parsers/</link>
		<comments>http://rantincsharp.wordpress.com/2009/03/11/xml-parsers/#comments</comments>
		<pubDate>Wed, 11 Mar 2009 11:20:45 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[xml-parsers]]></category>

		<guid isPermaLink="false">http://rantincsharp.wordpress.com/?p=86</guid>
		<description><![CDATA[Everything you need to know about parsing XML &#8211; without being baffled by long winded ramblings and flag waving for the latest/greatest frameworks.
There are 2 basic parsing strategies with XML.
1.  DOM &#8211; Document/tree based strategy.
2.  SAX &#8211; event based strategy.
DOM

Simple.
 Nested tree structure.
 Process and query with XPath or other parser supported functions.
 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rantincsharp.wordpress.com&blog=3622497&post=86&subd=rantincsharp&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Everything you need to know about parsing XML &#8211; without being baffled by long winded ramblings and flag waving for the latest/greatest frameworks.</p>
<p>There are 2 basic parsing strategies with XML.</p>
<p>1.  DOM &#8211; Document/tree based strategy.<br />
2.  SAX &#8211; event based strategy.</p>
<h2>DOM</h2>
<ul>
<li>Simple.</li>
<li> Nested tree structure.</li>
<li> Process and query with XPath or other parser supported functions.</li>
<li> Implements specific interface defined by W3C.</li>
<li> You have to load the whole document into memory &#8211; so if the XML is big &#8211; then you have to watch out.</li>
<li>Simple and large XML documents do not suit this style.</li>
<li>Random access to the document.</li>
</ul>
<h2>SAX</h2>
<ul>
<li>Complex to use.</li>
<li>Event based.</li>
<li>Starting/Ending tags, XML comments and entity declarations all raise events.</li>
<li>Flexible &#8211; you can handle events when needed, and take action on those events as they are raised.</li>
<li>Once events have been fired they are gone, you have to re-read the document again if you need to get back to the same bit of XML again.</li>
<li>Malformed XML can cause the code to fall into exception &#8211; make sure your document is well formed before passing to the parser.</li>
<li></li>
</ul>
<h2>C# and Java XML Implementations</h2>
<p>C#</p>
<ul>
<li>Look at System.Xml.XmlReader.</li>
<li>DOM trees can be used via XmlDocument &#8211; and XPathDocument lets you interrigate the tree nodes via XPath.</li>
</ul>
<p>Java (1.5)</p>
<ul>
<li>If you are using 1.5 you are in luck as this version includes the Apache Xerces project.</li>
<li>Look at packages javax.xml.* &#8211; this also has XPath functionality.</li>
<li>DOM functionality can be found in org.w3c.dom.*</li>
<li>If you are using Java 1.4 and below, you will have to install <a href="http://xerces.apache.org/xerces2-j/">Xerces</a>.</li>
</ul>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rantincsharp.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rantincsharp.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rantincsharp.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rantincsharp.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rantincsharp.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rantincsharp.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rantincsharp.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rantincsharp.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rantincsharp.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rantincsharp.wordpress.com/86/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rantincsharp.wordpress.com&blog=3622497&post=86&subd=rantincsharp&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://rantincsharp.wordpress.com/2009/03/11/xml-parsers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/959e169893c5d1a7b562c9dbdf750708?s=96&#38;d=identicon" medium="image">
			<media:title type="html">earnshaw</media:title>
		</media:content>
	</item>
		<item>
		<title>Asus Maximus II Formula Motherboard Design Fault</title>
		<link>http://rantincsharp.wordpress.com/2009/03/10/asus-maximus-ii-formula-motherboard-design-fault/</link>
		<comments>http://rantincsharp.wordpress.com/2009/03/10/asus-maximus-ii-formula-motherboard-design-fault/#comments</comments>
		<pubDate>Tue, 10 Mar 2009 11:05:53 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[hardware]]></category>
		<category><![CDATA[asus]]></category>
		<category><![CDATA[motherboard]]></category>
		<category><![CDATA[soundcard]]></category>
		<category><![CDATA[troubleshooter]]></category>

		<guid isPermaLink="false">http://rantincsharp.wordpress.com/?p=17</guid>
		<description><![CDATA[Got one of these babies the other day to swap out my existing dud motherboard.  It is quite nice and also comes with a X-Fi sound module (SupremeFX X-Fi Audio Card) that plugs into the motherboard &#8211; bonus!
Problem is that the fit of this sound module conflicts with the motherboard layout i.e. it can rest [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rantincsharp.wordpress.com&blog=3622497&post=17&subd=rantincsharp&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Got one of these babies the other day to swap out my existing dud motherboard.  It is quite nice and also comes with a X-Fi sound module (SupremeFX X-Fi Audio Card) that plugs into the motherboard &#8211; bonus!</p>
<p>Problem is that the fit of this sound module conflicts with the motherboard layout i.e. it can rest on top of the mounting screw, as the hole for the mouting screw is right underneath where the sound module would go &#8211; this will cause a short and cause your PC not to start up i.e. you will be able to switch the PC on &#8211; but the fans will work for 3 seconds and then it cuts out.</p>
<p>Simple thing to do is remove the mouting screw that is resting against the sound module.  You don&#8217;t necessarily need all the mounting screws in the motherboard to make it secure.   After you have done this your PC should boot up normally.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rantincsharp.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rantincsharp.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rantincsharp.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rantincsharp.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rantincsharp.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rantincsharp.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rantincsharp.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rantincsharp.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rantincsharp.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rantincsharp.wordpress.com/17/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rantincsharp.wordpress.com&blog=3622497&post=17&subd=rantincsharp&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://rantincsharp.wordpress.com/2009/03/10/asus-maximus-ii-formula-motherboard-design-fault/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/959e169893c5d1a7b562c9dbdf750708?s=96&#38;d=identicon" medium="image">
			<media:title type="html">earnshaw</media:title>
		</media:content>
	</item>
		<item>
		<title>Get your XML right &#8211; Elements vs Attributes</title>
		<link>http://rantincsharp.wordpress.com/2009/01/26/get-your-xml-right-elements-vs-attributes/</link>
		<comments>http://rantincsharp.wordpress.com/2009/01/26/get-your-xml-right-elements-vs-attributes/#comments</comments>
		<pubDate>Mon, 26 Jan 2009 17:53:20 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[data]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[attributes]]></category>
		<category><![CDATA[best-practice]]></category>
		<category><![CDATA[elements]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://rantincsharp.wordpress.com/?p=62</guid>
		<description><![CDATA[I have seen from time to time XML from various examples/tutorials/forums &#8211; explanations that are confusing and others that are just plain WRONG!  Most of it comes down to the inappropriate use of XML elements and attributes.  I also happen to think this is one of the most confusing and ambiguous asepects of XML &#8211; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rantincsharp.wordpress.com&blog=3622497&post=62&subd=rantincsharp&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I have seen from time to time XML from various examples/tutorials/forums &#8211; explanations that are confusing and others that are just plain WRONG!  Most of it comes down to the inappropriate use of XML elements and attributes.  I also happen to think this is one of the most confusing and ambiguous asepects of XML &#8211; but I think if you retain the following knowledge you should have little problems in forming your own correct XML documents.</p>
<p>Always bear in mind that &#8220;attribute&#8221; is essentially metadata i.e. something that describes something about the data.  I think a lot of people get confused with the actual terminology &#8211; &#8220;attribute&#8221;, thinking that the main element should have attribute data e.g.:</p>
<p><code>&lt;part description="some part" price="£12.34" location="A1B2"&gt;</code></p>
<p>Don&#8217;t fall into that trap, it will cause you no end of problems, as <a href="http://www.w3schools.com/DTD/dtd_el_vs_attr.asp">W3School </a>explains:</p>
<ul>
<li>attributes cannot contain multiple values (child elements can)</li>
<li>attributes are not easily expandable (for future changes)</li>
<li>attributes cannot describe structures (child elements can)</li>
<li>attributes are more difficult to manipulate by program code</li>
<li>attribute values are not easy to test against a DTD</li>
</ul>
<p>I can&#8217;t think of a reason why you would want to store your data in such a way.  The correct way would be to do the following:</p>
<pre><code>&lt;part&gt;
    &lt;description&gt;some part&lt;/description&gt;
    &lt;price&gt;£12.34&lt;/price&gt;
    &lt;location&gt;A1B2&lt;/location&gt;
&lt;/part&gt;

</code></pre>
<p>Each peice of data is represented in it&#8217;s own element tag and not stored as an attribute to some arbitary first element.</p>
<p>The rule to remember is &#8211; if it looks like data  then store as an element.  The next question you are probably thinking is &#8211; when should I use attributes then?  There are no hard and fast rules &#8211; annoying I know, but one possible scenario for using an attribute could be as an ID attribute &#8211; something that is not intrinsically part of the data but can be used to help identify or tell you something extra about the data.</p>
<p>Conclusion: Use elements to store data, use attributes to describe something about the data.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rantincsharp.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rantincsharp.wordpress.com/62/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rantincsharp.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rantincsharp.wordpress.com/62/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rantincsharp.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rantincsharp.wordpress.com/62/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rantincsharp.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rantincsharp.wordpress.com/62/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rantincsharp.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rantincsharp.wordpress.com/62/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rantincsharp.wordpress.com&blog=3622497&post=62&subd=rantincsharp&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://rantincsharp.wordpress.com/2009/01/26/get-your-xml-right-elements-vs-attributes/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/959e169893c5d1a7b562c9dbdf750708?s=96&#38;d=identicon" medium="image">
			<media:title type="html">earnshaw</media:title>
		</media:content>
	</item>
		<item>
		<title>Beginners resources for REST web service with Eclipse</title>
		<link>http://rantincsharp.wordpress.com/2008/12/15/beginners-resources-for-rest-web-service-with-eclipse/</link>
		<comments>http://rantincsharp.wordpress.com/2008/12/15/beginners-resources-for-rest-web-service-with-eclipse/#comments</comments>
		<pubDate>Mon, 15 Dec 2008 20:09:46 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[rest-webservice]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[web-services]]></category>

		<guid isPermaLink="false">http://rantincsharp.wordpress.com/?p=58</guid>
		<description><![CDATA[Just thought I&#8217;d quickly mention some good resources for learning the REST paradigm (having now moved on from SOAP web services.  These are basically resources I wish I had found on day 1.
The following is bearing in mind you are using the Restlet framework.
Again, a total lack of any decent, comprehensible tutorial material on the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rantincsharp.wordpress.com&blog=3622497&post=58&subd=rantincsharp&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Just thought I&#8217;d quickly mention some good resources for learning the REST paradigm (having now moved on from SOAP web services.  These are basically resources I wish I had found on day 1.</p>
<p>The following is bearing in mind you are using the <a href="http://www.restlet.org/">Restlet</a> framework.</p>
<p>Again, a total lack of any decent, comprehensible tutorial material on the net, but I did unearth a gem from IBM&#8217;s website (you do have to register to download the doc, but it is free):</p>
<p><a href="http://www.ibm.com/developerworks/edu/j-dw-java-rest-i.html">Build a RESTful Web service &#8211; An introduction to REST and the Restlet framework by Andrew Glover.</a></p>
<p>Also to back up your knowledge and to help you understand the above tutorial, I would suggest reading:</p>
<p><a href="http://oreilly.com/catalog/9780596529260/">RESTful Web Services by Leornard Richardson and Sam Ruby from O&#8217;Reilly.</a></p>
<p>Enjoy!</p>
<p>PS &#8211; Hope to publish my findings on a making my first RESTful web service that writes into a database.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rantincsharp.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rantincsharp.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rantincsharp.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rantincsharp.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rantincsharp.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rantincsharp.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rantincsharp.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rantincsharp.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rantincsharp.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rantincsharp.wordpress.com/58/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rantincsharp.wordpress.com&blog=3622497&post=58&subd=rantincsharp&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://rantincsharp.wordpress.com/2008/12/15/beginners-resources-for-rest-web-service-with-eclipse/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/959e169893c5d1a7b562c9dbdf750708?s=96&#38;d=identicon" medium="image">
			<media:title type="html">earnshaw</media:title>
		</media:content>
	</item>
		<item>
		<title>Update to Visual Inheritance</title>
		<link>http://rantincsharp.wordpress.com/2008/10/23/update-to-visual-inheritance/</link>
		<comments>http://rantincsharp.wordpress.com/2008/10/23/update-to-visual-inheritance/#comments</comments>
		<pubDate>Thu, 23 Oct 2008 08:19:43 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[c#]]></category>
		<category><![CDATA[hint]]></category>
		<category><![CDATA[visual-inheritance]]></category>
		<category><![CDATA[visual-studio]]></category>

		<guid isPermaLink="false">http://rantincsharp.wordpress.com/?p=33</guid>
		<description><![CDATA[After &#8216;writing off&#8217; Visual Inheritance &#8211; I still found that I was stuck with it in my application &#8211; just so many things depended on it working.  I&#8217;m still annoyed about it being buggy and doing unexpected things &#8211; but I have come up with a list of things to do in order to keep [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rantincsharp.wordpress.com&blog=3622497&post=33&subd=rantincsharp&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>After &#8216;writing off&#8217; Visual Inheritance &#8211; I still found that I was stuck with it in my application &#8211; just so many things depended on it working.  I&#8217;m still annoyed about it being buggy and doing unexpected things &#8211; but I have come up with a list of things to do in order to keep VI ticking over &#8211; maybe you will find these useful too:</p>
<ul>
<li>No abstract control types</li>
<li>No constructor arguments</li>
<li>Initialisation moved to Form_Load as opposed to the constructor</li>
<li>No controls nested in another windows control e.g. toolstrip.</li>
<li>Close all documents -&gt; Clean -&gt; Rebuild</li>
<li>Restart Visual Studio</li>
</ul>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rantincsharp.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rantincsharp.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rantincsharp.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rantincsharp.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rantincsharp.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rantincsharp.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rantincsharp.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rantincsharp.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rantincsharp.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rantincsharp.wordpress.com/33/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rantincsharp.wordpress.com&blog=3622497&post=33&subd=rantincsharp&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://rantincsharp.wordpress.com/2008/10/23/update-to-visual-inheritance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/959e169893c5d1a7b562c9dbdf750708?s=96&#38;d=identicon" medium="image">
			<media:title type="html">earnshaw</media:title>
		</media:content>
	</item>
		<item>
		<title>Connecting to AGS to get IMap</title>
		<link>http://rantincsharp.wordpress.com/2008/10/21/connecting-to-ags-to-get-imap/</link>
		<comments>http://rantincsharp.wordpress.com/2008/10/21/connecting-to-ags-to-get-imap/#comments</comments>
		<pubDate>Tue, 21 Oct 2008 15:04:28 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[gis]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[ags]]></category>
		<category><![CDATA[arcgis-server]]></category>
		<category><![CDATA[arcobjects]]></category>
		<category><![CDATA[code-sample]]></category>

		<guid isPermaLink="false">http://rantincsharp.wordpress.com/?p=31</guid>
		<description><![CDATA[Want to know how connect to your AGS server and get a handle on IMap of your published AGS map service.  The following code should give you the basic bare bones code that you need in order to do that &#8211; note stuff in &#8220;&#8221; should be applicable to your environment.
BTW &#8211; I find that [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rantincsharp.wordpress.com&blog=3622497&post=31&subd=rantincsharp&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Want to know how connect to your AGS server and get a handle on IMap of your published AGS map service.  The following code should give you the basic bare bones code that you need in order to do that &#8211; note stuff in &#8220;&#8221; should be applicable to your environment.</p>
<p>BTW &#8211; I find that getting a handle on IMap is useful in a great many ArcObjects based programming &#8211; so just thought I should post.</p>
<pre><span style="color:#0000ff;">private String _host = "myServerName";
private String _username = "joebloggs";
private String _password = "password";
private String _domain = "myDomainName";</span>
<span style="color:#0000ff;">public void connectToServer()throws IOException
    {
        try {
            IServerContext serverContext = null;
            IServerConnection serverConnection = new ServerConnection();
            ServerInitializer serverInitializer = null;
            IServerObjectManager som = null;

            serverInitializer = new ServerInitializer();
            serverInitializer.initializeServer(_domain, _username, _password);
            serverConnection.connect(_host);
            som = serverConnection.getServerObjectManager();
            serverContext = som.createServerContext("publishedMapServiceName", "MapServer");

            IMapServer mapServer = (IMapServer) serverContext.getServerObject();
            IMapServerObjects mapServObjs = (IMapServerObjects) mapServer;

            IMap map = mapServObjs.getMap(mapServer.getDefaultMapName());

            serverContext.releaseContext();

        } catch (UnknownHostException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (AutomationException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }</span></pre>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rantincsharp.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rantincsharp.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rantincsharp.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rantincsharp.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rantincsharp.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rantincsharp.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rantincsharp.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rantincsharp.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rantincsharp.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rantincsharp.wordpress.com/31/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rantincsharp.wordpress.com&blog=3622497&post=31&subd=rantincsharp&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://rantincsharp.wordpress.com/2008/10/21/connecting-to-ags-to-get-imap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/959e169893c5d1a7b562c9dbdf750708?s=96&#38;d=identicon" medium="image">
			<media:title type="html">earnshaw</media:title>
		</media:content>
	</item>
		<item>
		<title>Graphics Hint &#8211; Resizing Images</title>
		<link>http://rantincsharp.wordpress.com/2008/10/15/graphics-hint-resizing-images/</link>
		<comments>http://rantincsharp.wordpress.com/2008/10/15/graphics-hint-resizing-images/#comments</comments>
		<pubDate>Wed, 15 Oct 2008 16:13:47 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[graphics]]></category>
		<category><![CDATA[bicubic]]></category>
		<category><![CDATA[bilinear]]></category>
		<category><![CDATA[hint]]></category>
		<category><![CDATA[images]]></category>
		<category><![CDATA[resizing]]></category>

		<guid isPermaLink="false">http://rantincsharp.wordpress.com/?p=23</guid>
		<description><![CDATA[At some point we may find ourselves piddling around with images for creating splash screens, icons and web design.  Interesting little hint about what resizing algorithms you should use in your favourite graphics prog:

When REDUCING a big image to a small image use BICUBIC
When INCREASING a small image to a big image use BILINEAR

&#8230;.I always [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rantincsharp.wordpress.com&blog=3622497&post=23&subd=rantincsharp&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>At some point we may find ourselves piddling around with images for creating splash screens, icons and web design.  Interesting little hint about what resizing algorithms you should use in your favourite graphics prog:</p>
<ul>
<li>When REDUCING a big image to a small image use BICUBIC</li>
<li>When INCREASING a small image to a big image use BILINEAR</li>
</ul>
<p>&#8230;.I always forget this simple but useful information.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rantincsharp.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rantincsharp.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rantincsharp.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rantincsharp.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rantincsharp.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rantincsharp.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rantincsharp.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rantincsharp.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rantincsharp.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rantincsharp.wordpress.com/23/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rantincsharp.wordpress.com&blog=3622497&post=23&subd=rantincsharp&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://rantincsharp.wordpress.com/2008/10/15/graphics-hint-resizing-images/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/959e169893c5d1a7b562c9dbdf750708?s=96&#38;d=identicon" medium="image">
			<media:title type="html">earnshaw</media:title>
		</media:content>
	</item>
		<item>
		<title>A Simple SOAP Web Service Example in Eclipse (Ganymede)</title>
		<link>http://rantincsharp.wordpress.com/2008/10/14/a-simple-soap-web-service-example-in-eclipse-ganymede/</link>
		<comments>http://rantincsharp.wordpress.com/2008/10/14/a-simple-soap-web-service-example-in-eclipse-ganymede/#comments</comments>
		<pubDate>Tue, 14 Oct 2008 19:14:32 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[axis]]></category>
		<category><![CDATA[client]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[example]]></category>
		<category><![CDATA[ganymede]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[web-services]]></category>
		<category><![CDATA[wsdl]]></category>

		<guid isPermaLink="false">http://rantincsharp.wordpress.com/?p=19</guid>
		<description><![CDATA[Huh?  Not C#!!! &#8211; What&#8217;s all this &#8220;Rant in C Sharp&#8221; business then!?  Well, sometimes you have to be flexible in your job &#8211; well, lets just say we should be &#8216;language ambivalent&#8217;.
This is a VERY simple attempt to show show how to create a web service in Eclipse using Axis.  There is also some [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rantincsharp.wordpress.com&blog=3622497&post=19&subd=rantincsharp&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Huh?  Not C#!!! &#8211; What&#8217;s all this &#8220;Rant in C Sharp&#8221; business then!?  Well, sometimes you have to be flexible in your job &#8211; well, lets just say we should be &#8216;language ambivalent&#8217;.</p>
<p>This is a VERY simple attempt to show show how to create a web service in Eclipse using Axis.  There is also some client code to show how you would interact with that web service.  For some reason I had to delve into a bazillion websites and scour a million books before I could make some sort of sense of it all &#8211; so just so you don&#8217;t have the same trouble &#8211; I have decided to publish it (well actually, it&#8217;s so that I don&#8217;t forget either).</p>
<p>Little disclaimer &#8211; I&#8217;m not saying that this is difinitive, I may be missing something, but it seems to work for me just now, and I haven&#8217;t gone into all the &#8216;bells and whistles&#8217; of web services.  At the moment I&#8217;m writing down everything I learn and hopefully help others by sharing the knowledge.</p>
<p>(Using Java 1.5)</p>
<h2><strong>Create Basic Web Service</strong></h2>
<ol>
<li>Create new Dynamic Web Project.</li>
<li>Create new Java class (call it &#8220;DoesMagic&#8221;).</li>
<li>Add method like this (perhaps):</li>
</ol>
<pre class="brush: java;">
public class DoesMagic{
    public String doBasicStuff(String message)
    {
        return &quot;This is your message: &quot; + message;
    }
}
</pre>
<p>4. Right click on class you just made, New -&gt; Other -&gt; Web Services -&gt; Web Service, you should get a form like the one below:</p>
<p><a href="http://rantincsharp.files.wordpress.com/2008/10/webservice.gif"><img class="size-full wp-image-20 alignnone" title="webservice" src="http://rantincsharp.files.wordpress.com/2008/10/webservice.gif?w=375&#038;h=530" alt="" width="375" height="530" /></a></p>
<p>This will create all the necessary files to be able to publish your class as a web service.  If you want you can also create a client automatically by moving the slider &#8211; but what it generates may be hard to understand at first glance, so I have written a simple example of client code (see later on&#8230;).</p>
<p>5.  In order to run the web service &#8211; just,  Run as -&gt; Run on Server.  Once the web service is running and alive on Tomcat &#8211; then we should be able to use it via some client code (see next bit).</p>
<h2 style="padding-left:30px;">Create Basic Web Service Client</h2>
<p>Must create a project that has all the axis.jar type stuff in the WebContent folder &#8211; this can usually be made by generating a client application via the above wizard &#8211; you don&#8217;t have to use all the auto generated classes to access your web service, just do the following:</p>
<p>1.  Create a new Java Class &#8211; call it TestClient.</p>
<p>2.  Make it a main class, and enter the following code:</p>
<pre class="brush: java;">

import javax.xml.namespace.QName;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;

public class TestClient {

public static void main(String [] args)
{
    try{
       String endpoint = &quot;http://localhost:8080/TestWebService/services/DoesMagic&quot;;

       Service service = new Service();
       Call call = (Call) service.createCall();
       call.setTargetEndpointAddress( new java.net.URL(endpoint) );
       call.setOperationName( new QName(&quot;http://testPackage.fc.com&quot;, &quot;doBasicStuff&quot;) );

       String ret = (String) call.invoke( new Object[] {&quot;Hello World&quot;} );
       System.out.println(ret);
       }
       catch(Exception e){
           System.err.println(e.toString());
       }
}
}
</pre>
<p>3.  Go to your web service project you made before and look at the source code for the wsdl file that has been created.  It&#8217;s in the folder WebContent -&gt; wsdl.  Inside there you will find a wsdl that is the same name as your class.</p>
<p>4. You need to look at the wsdl and find the endpoint &#8211; which looks similar to:</p>
<pre style="padding-left:30px;"><span style="color:#0000ff;">"<span style="color:#ff0000;">http://localhost:8080/TestWebService/services/DoesMagic</span>"</span></pre>
<p style="padding-left:30px;">and you need to get the namespace and the method name you want to invoke  (as shown above, should be in a very similar format).</p>
<p style="padding-left:30px;">5. In this case, when we get to the point that the call.invoke command is being issued it is casting the result to a String and we are sending in a String called &#8220;Hello World&#8221; &#8211; this should create a message in the console like &#8220;This is your message: Hello World&#8221;.</p>
<p style="padding-left:30px;">6. To test the class, just run the project as a Java Application and you should see the result in the Console printed out.</p>
<p style="padding-left:30px;">
<h2 style="padding-left:30px;">Conclusion</h2>
<p style="padding-left:30px;">This is not indepth &#8211; this may not even be 100% correct, but it just gives you a taste of what can be achieved &#8211; it&#8217;s up to you now to read up more on Java Web Services.  Good luck !</p>
<p style="padding-left:30px;"><strong>PS &#8211; Take a sec just to vote whether this article helped you or not &#8211; see widget below.  If not, tell me what&#8217;t wrong with it and I&#8217;ll try and improve it.  I love feedback so I look forward to your comments!</strong></p>
<p style="padding-left:30px;">
<p style="padding-left:30px;"><a name="pd_a_1056113"></a><div class="PDS_Poll" id="PDI_container1056113" style="display:inline-block;"></div><script type="text/javascript" language="javascript" charset="utf-8" src="http://static.polldaddy.com/p/1056113.js"></script>
		<noscript>
		<a href="http://answers.polldaddy.com/poll/1056113/">View This Poll</a><br/><span style="font-size:10px;"><a href="http://www.polldaddy.com">survey software</a></span>
		</noscript></p>
<p style="padding-left:30px;">
<p style="padding-left:30px;">
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rantincsharp.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rantincsharp.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rantincsharp.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rantincsharp.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rantincsharp.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rantincsharp.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rantincsharp.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rantincsharp.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rantincsharp.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rantincsharp.wordpress.com/19/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rantincsharp.wordpress.com&blog=3622497&post=19&subd=rantincsharp&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://rantincsharp.wordpress.com/2008/10/14/a-simple-soap-web-service-example-in-eclipse-ganymede/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/959e169893c5d1a7b562c9dbdf750708?s=96&#38;d=identicon" medium="image">
			<media:title type="html">earnshaw</media:title>
		</media:content>

		<media:content url="http://rantincsharp.files.wordpress.com/2008/10/webservice.gif" medium="image">
			<media:title type="html">webservice</media:title>
		</media:content>
	</item>
	</channel>
</rss>