<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7542889160674991776</id><updated>2011-10-08T11:33:52.893+03:00</updated><category term='pictures'/><category term='fun'/><category term='css'/><category term='tips'/><title type='text'>Emil Genov</title><subtitle type='html'>Learn, Practice &amp; Share</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://www.emil-genov.info/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7542889160674991776/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://www.emil-genov.info/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Emo</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://photos1.blogger.com/blogger/2864/364/400/EmoPic.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>19</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7542889160674991776.post-1112487261598926626</id><published>2011-01-10T00:02:00.001+02:00</published><updated>2011-01-10T00:08:16.135+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tips'/><title type='text'>Forwarding AFTER filtering in Gmail</title><content type='html'>&lt;b&gt;The problem:&lt;/b&gt; I want to forward all of my mail to other email account (for example my cell phone Email2SMS address). I want to be able to filter some of the messages using gmail filters, and I do not want to forward those filtered messages.&lt;br /&gt;&lt;br /&gt;Problem is that gmail, first forwards messages and after that applies filters, just the opposite of what I need.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Solution:&lt;/b&gt; Well it's a little convoluted but it works. What I needed, was a forwarding filter that will will forward mail coming from any address, except those from a specific list.&lt;br /&gt;&lt;br /&gt;As it took me some time to figure out the right syntax (try and error), I decided to write it down for someone who will need it too.&lt;br /&gt;&lt;br /&gt;You can use two filters, first filters unwanted mail, second forwards wanted ones:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;1) Matches: from:(not_wanted1@mail.com | not_wanted2@mail.com | not_wanted3@mail.com)&lt;br /&gt;Do this: Skip Inbox, Mark as read, Delete it&lt;br /&gt;&lt;br /&gt;2) Matches: &lt;span class="qW"&gt;from:(-&lt;/span&gt;not_wanted1@mail.com&lt;span class="qW"&gt;,&lt;wbr&gt;&lt;/wbr&gt;-&lt;/span&gt;not_wanted1@mail.com&lt;span class="qW"&gt;,-&lt;/span&gt;not_wanted1@mail.com&lt;span class="qW"&gt;)&lt;/span&gt;&lt;br /&gt;Do this: Forward to you-address@sms.mtel.net&lt;/blockquote&gt;&lt;br /&gt;So syntax for filter that matched mail send from any address, except those from a specific list is like this: put a minus in front of address and use comma as list separator. Hope this will help someone, write comment if this got the things done.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7542889160674991776-1112487261598926626?l=www.emil-genov.info' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.emil-genov.info/feeds/1112487261598926626/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7542889160674991776&amp;postID=1112487261598926626' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7542889160674991776/posts/default/1112487261598926626'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7542889160674991776/posts/default/1112487261598926626'/><link rel='alternate' type='text/html' href='http://www.emil-genov.info/2011/01/forwarding-after-filtering-in-gmail.html' title='Forwarding AFTER filtering in Gmail'/><author><name>Emo</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://photos1.blogger.com/blogger/2864/364/400/EmoPic.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7542889160674991776.post-5085892922446924810</id><published>2010-12-28T11:34:00.001+02:00</published><updated>2010-12-28T11:37:58.044+02:00</updated><title type='text'>IM History Converter Application</title><content type='html'>When transitioning to a new job, I got faced with problem of what to do with chat histories I have amassed in my last job. We have used pidgin for communication with jabber servers, and I have also used pidgin for my facebook chat, so all my work related history along with my private history was there.&lt;br /&gt;&lt;br /&gt;I really wanted some central storage for this information. After pounding on solutions, I realized that it was there, already existing, waiting for me. Google stores it chat logs inside gmail. Wonderful idea, chats there are safe, easy accessible and what is most important completely search-able.&lt;br /&gt;&lt;br /&gt;So I looked through Interwebs, for existing solution, but could not find one. Then I looked at format of pidgin history, and it was simple enough. Text file with each chat, and index files in xml.&lt;br /&gt;&lt;br /&gt;I decided I will write this translator myself. Started with defining core objects, such as Contacts, IM Account and chat history logs. Also I decided to make it extensible for other input formats and also for other storage backends. Decision which plugin to use is taken in runtime based on configuration file or user entered parameters.&lt;br /&gt;&lt;br /&gt;Gmail storage plugin uses IMAP to directly put chat histories as gmail messages with their original dates.&lt;br /&gt;&lt;br /&gt;&lt;a href="https://code.google.com/p/im-history-converter/"&gt;So If anybody needs it, source code is available.&lt;/a&gt; On project page there are descriptions how to run the program. Also you can see how to make and run additional plugins to import chat from other systems. If anybody finds application useful, or have added additional plugins, please write a comment here or contact me on project page. Gracias&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7542889160674991776-5085892922446924810?l=www.emil-genov.info' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='https://code.google.com/p/im-history-converter/' title='IM History Converter Application'/><link rel='replies' type='application/atom+xml' href='http://www.emil-genov.info/feeds/5085892922446924810/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7542889160674991776&amp;postID=5085892922446924810' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7542889160674991776/posts/default/5085892922446924810'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7542889160674991776/posts/default/5085892922446924810'/><link rel='alternate' type='text/html' href='http://www.emil-genov.info/2010/12/im-history-converter-application.html' title='IM History Converter Application'/><author><name>Emo</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://photos1.blogger.com/blogger/2864/364/400/EmoPic.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7542889160674991776.post-579425030727603663</id><published>2010-10-29T11:07:00.007+03:00</published><updated>2010-10-29T11:27:57.027+03:00</updated><title type='text'>Tagging maven build with SVN version, and using this version inside application</title><content type='html'>To do this, you need to take following steps:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Add build-number plugin to your project main POM&lt;br /&gt;&lt;pre&gt;...&lt;br /&gt;      &amp;lt;build&amp;gt;&lt;br /&gt;              ...&lt;br /&gt;              &amp;lt;plugins&amp;gt;&lt;br /&gt;                  ...&lt;br /&gt;                  &amp;lt;plugin&amp;gt;&lt;br /&gt;                      &amp;lt;groupId&amp;gt;org.codehaus.mojo&amp;lt;/groupId&amp;gt;&lt;br /&gt;                      &amp;lt;artifactId&amp;gt;buildnumber-maven-plugin&amp;lt;/artifactId&amp;gt;&lt;br /&gt;                      &amp;lt;version&amp;gt;1.0-beta-3&amp;lt;/version&amp;gt;&lt;br /&gt;                      &amp;lt;executions&amp;gt;&lt;br /&gt;                          &amp;lt;execution&amp;gt;&lt;br /&gt;                              &amp;lt;phase&amp;gt;validate&amp;lt;/phase&amp;gt;&lt;br /&gt;                              &amp;lt;goals&amp;gt;&lt;br /&gt;                                  &amp;lt;goal&amp;gt;create&amp;lt;/goal&amp;gt;&lt;br /&gt;                              &amp;lt;/goals&amp;gt;&lt;br /&gt;                          &amp;lt;/execution&amp;gt;&lt;br /&gt;                      &amp;lt;/executions&amp;gt;&lt;br /&gt;                      &amp;lt;configuration&amp;gt;&lt;br /&gt;                          &amp;lt;doCheck&amp;gt;false&amp;lt;/doCheck&amp;gt;&lt;br /&gt;                          &amp;lt;doUpdate&amp;gt;false&amp;lt;/doUpdate&amp;gt;&lt;br /&gt;                      &amp;lt;/configuration&amp;gt;&lt;br /&gt;                  &amp;lt;/plugin&amp;gt;&lt;br /&gt;                  &amp;lt;plugin&amp;gt;&lt;br /&gt;                      &amp;lt;groupId&amp;gt;org.apache.maven.plugins&amp;lt;/groupId&amp;gt;&lt;br /&gt;                      &amp;lt;artifactId&amp;gt;maven-release-plugin&amp;lt;/artifactId&amp;gt;&lt;br /&gt;                      &amp;lt;version&amp;gt;2.0&amp;lt;/version&amp;gt;&lt;br /&gt;                  &amp;lt;/plugin&amp;gt;&lt;br /&gt;                  ...&lt;br /&gt;              &amp;lt;/plugins&amp;gt;&lt;br /&gt;          ...&lt;br /&gt;      &amp;lt;/build&amp;gt;&lt;br /&gt;      ...&lt;br /&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;Change your current jar plugin (or add one if such is missing):&lt;br /&gt;&lt;pre&gt;...&lt;br /&gt;                   &amp;lt;plugin&amp;gt;&lt;br /&gt;                      &amp;lt;artifactId&amp;gt;maven-assembly-plugin&amp;lt;/artifactId&amp;gt;&lt;br /&gt;                      &amp;lt;version&amp;gt;2.2-beta-2&amp;lt;/version&amp;gt;&lt;br /&gt;                      &amp;lt;configuration&amp;gt;&lt;br /&gt;                          &amp;lt;archive&amp;gt;&lt;br /&gt;                              ...&lt;br /&gt;                              &amp;lt;manifest&amp;gt;&lt;br /&gt;                                  ...    &lt;br /&gt;                                  &amp;lt;addDefaultImplementationEntries&amp;gt;true&amp;lt;/addDefaultImplementationEntries&amp;gt;&lt;br /&gt;                                  ...&lt;br /&gt;                              &amp;lt;/manifest&amp;gt;&lt;br /&gt;                              &amp;lt;manifestEntries&amp;gt;&lt;br /&gt;                                  &amp;lt;Implementation-Version&amp;gt;${pom.version} (SVN version:${buildNumber})&amp;lt;/Implementation-Version&amp;gt;&lt;br /&gt;                                  &amp;lt;SVN-Version&amp;gt;${buildNumber}&amp;lt;/SVN-Version&amp;gt;&lt;br /&gt;                              &amp;lt;/manifestEntries&amp;gt;&lt;br /&gt;                              ...&lt;br /&gt;                          &amp;lt;/archive&amp;gt;&lt;br /&gt;                          ...&lt;br /&gt;                      &amp;lt;/configuration&amp;gt;&lt;br /&gt;                      &amp;lt;executions&amp;gt;&lt;br /&gt;                          &amp;lt;execution&amp;gt;&lt;br /&gt;                              &amp;lt;goals&amp;gt;&lt;br /&gt;                                  &amp;lt;goal&amp;gt;single&amp;lt;/goal&amp;gt;&lt;br /&gt;                              &amp;lt;/goals&amp;gt;&lt;br /&gt;                              &amp;lt;phase&amp;gt;package&amp;lt;/phase&amp;gt;&lt;br /&gt;                          &amp;lt;/execution&amp;gt;&lt;br /&gt;                      &amp;lt;/executions&amp;gt;&lt;br /&gt;                  &amp;lt;/plugin&amp;gt;&lt;br /&gt;                  ...&lt;br /&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;To get version inside your code use: &lt;pre&gt;public String getVersion() {&lt;br /&gt;    return &amp;lt;some class inside jar, that is created by maven&amp;gt;.class.getPackage().getImplementationVersion();&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;&lt;br /&gt;To get version from running program (server) using only command line:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Create an JMX interface, with method getVersion() exposed, expose this interface in JMX on host XXX.YYY.ZZZ on port PPP&lt;/li&gt;&lt;li&gt;Download &lt;a href="http://crawler.archive.org/cmdline-jmxclient/cmdline-jmxclient-0.10.3.jar"&gt;cmdline-jmxclient utility jar from it's site&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Issue this:&lt;br /&gt;&lt;pre&gt;java -jar cmdline-jmxclient-0.10.3.jar a:a  XXX.YYY.ZZZ:PPP &amp;lt;name of your JMX bean&amp;gt; Version&lt;br /&gt;&lt;/pre&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7542889160674991776-579425030727603663?l=www.emil-genov.info' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.emil-genov.info/feeds/579425030727603663/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7542889160674991776&amp;postID=579425030727603663' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7542889160674991776/posts/default/579425030727603663'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7542889160674991776/posts/default/579425030727603663'/><link rel='alternate' type='text/html' href='http://www.emil-genov.info/2010/10/to-do-this-you-need-to-take-following.html' title='Tagging maven build with SVN version, and using this version inside application'/><author><name>Emo</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://photos1.blogger.com/blogger/2864/364/400/EmoPic.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7542889160674991776.post-3091185119447951713</id><published>2009-11-06T19:52:00.001+02:00</published><updated>2010-12-22T19:58:32.661+02:00</updated><title type='text'>Team time</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_J00sPFsIEVY/TRI7re0XgrI/AAAAAAAAEu8/6nDFMri0pDM/s1600/3616942227_92de5ca0a0_z.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="268" src="http://1.bp.blogspot.com/_J00sPFsIEVY/TRI7re0XgrI/AAAAAAAAEu8/6nDFMri0pDM/s400/3616942227_92de5ca0a0_z.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;The river was not really nasty this time, but it was a quite an adventure. After safely got on land, we celebrated this with a big lunch :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7542889160674991776-3091185119447951713?l=www.emil-genov.info' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.emil-genov.info/feeds/3091185119447951713/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7542889160674991776&amp;postID=3091185119447951713' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7542889160674991776/posts/default/3091185119447951713'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7542889160674991776/posts/default/3091185119447951713'/><link rel='alternate' type='text/html' href='http://www.emil-genov.info/2009/11/team-time.html' title='Team time'/><author><name>Emo</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://photos1.blogger.com/blogger/2864/364/400/EmoPic.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_J00sPFsIEVY/TRI7re0XgrI/AAAAAAAAEu8/6nDFMri0pDM/s72-c/3616942227_92de5ca0a0_z.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7542889160674991776.post-1048101244001160989</id><published>2009-07-09T19:59:00.002+03:00</published><updated>2010-12-22T20:04:52.477+02:00</updated><title type='text'>Robots at work</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;object class="BLOGGER-youtube-video" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" data-thumbnail-src="http://0.gvt0.com/vi/lWsMdN7HMuA/0.jpg" height="266" width="320"&gt;&lt;param name="movie" value="http://www.youtube.com/v/lWsMdN7HMuA&amp;fs=1&amp;source=uds" /&gt;&lt;param name="bgcolor" value="#FFFFFF" /&gt;&lt;embed width="320" height="266" src="http://www.youtube.com/v/lWsMdN7HMuA&amp;fs=1&amp;source=uds" type="application/x-shockwave-flash"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;&lt;br /&gt;This might be the future of MFC technology we work now with. Worth a try.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7542889160674991776-1048101244001160989?l=www.emil-genov.info' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.techcrunch.com/2009/09/07/workers-of-the-world-meet-your-robot-replacements/' title='Robots at work'/><link rel='replies' type='application/atom+xml' href='http://www.emil-genov.info/feeds/1048101244001160989/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7542889160674991776&amp;postID=1048101244001160989' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7542889160674991776/posts/default/1048101244001160989'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7542889160674991776/posts/default/1048101244001160989'/><link rel='alternate' type='text/html' href='http://www.emil-genov.info/2009/07/robots-at-work.html' title='Robots at work'/><author><name>Emo</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://photos1.blogger.com/blogger/2864/364/400/EmoPic.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7542889160674991776.post-1182047696698525734</id><published>2009-04-14T09:50:00.005+03:00</published><updated>2009-04-14T09:53:26.694+03:00</updated><title type='text'>You are being monitored</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_J00sPFsIEVY/SeQyxdPh7fI/AAAAAAAAEJ4/1iF65ch5Mhc/s1600-h/_BeingMonitored.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 400px; height: 400px;" src="http://1.bp.blogspot.com/_J00sPFsIEVY/SeQyxdPh7fI/AAAAAAAAEJ4/1iF65ch5Mhc/s400/_BeingMonitored.jpg" alt="" id="BLOGGER_PHOTO_ID_5324436484703514098" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7542889160674991776-1182047696698525734?l=www.emil-genov.info' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.emil-genov.info/feeds/1182047696698525734/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7542889160674991776&amp;postID=1182047696698525734' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7542889160674991776/posts/default/1182047696698525734'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7542889160674991776/posts/default/1182047696698525734'/><link rel='alternate' type='text/html' href='http://www.emil-genov.info/2009/04/youve-been-monitored.html' title='You are being monitored'/><author><name>Emo</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://photos1.blogger.com/blogger/2864/364/400/EmoPic.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_J00sPFsIEVY/SeQyxdPh7fI/AAAAAAAAEJ4/1iF65ch5Mhc/s72-c/_BeingMonitored.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7542889160674991776.post-3667285440482135821</id><published>2007-11-26T11:43:00.000+02:00</published><updated>2007-11-26T11:44:08.086+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='fun'/><title type='text'>Oldie, but Goldie ...</title><content type='html'>&lt;img src="http://www.linuxkungfu.org/images/fun/geek/project.jpg" border="0"/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7542889160674991776-3667285440482135821?l=www.emil-genov.info' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.emil-genov.info/feeds/3667285440482135821/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7542889160674991776&amp;postID=3667285440482135821' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7542889160674991776/posts/default/3667285440482135821'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7542889160674991776/posts/default/3667285440482135821'/><link rel='alternate' type='text/html' href='http://www.emil-genov.info/2007/11/oldie-but-goldie.html' title='Oldie, but Goldie ...'/><author><name>Emo</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://photos1.blogger.com/blogger/2864/364/400/EmoPic.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7542889160674991776.post-6977481237986762496</id><published>2007-10-24T21:06:00.000+03:00</published><updated>2007-10-24T21:07:04.499+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='fun'/><title type='text'>Language talks :)</title><content type='html'>&lt;a href="http://davidrupp.blogspot.com/2007/10/last-language-war-language-trolling.html"&gt;The Last Language War / Language Trolling Post You'll Ever Need To Read (Hopefully)&lt;/a&gt; - I never have so much laugh since reading &lt;a href="http://www.geocities.com/heartland/plains/6271/compu025.html"&gt;How to shoot yourself in the leg&lt;/a&gt;... which by the way seems a lot of outdated.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7542889160674991776-6977481237986762496?l=www.emil-genov.info' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.emil-genov.info/feeds/6977481237986762496/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7542889160674991776&amp;postID=6977481237986762496' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7542889160674991776/posts/default/6977481237986762496'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7542889160674991776/posts/default/6977481237986762496'/><link rel='alternate' type='text/html' href='http://www.emil-genov.info/2007/10/language-talks.html' title='Language talks :)'/><author><name>Emo</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://photos1.blogger.com/blogger/2864/364/400/EmoPic.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7542889160674991776.post-3758430851124795827</id><published>2007-10-14T20:24:00.000+03:00</published><updated>2007-10-14T20:35:39.842+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='css'/><title type='text'>Classes vs. Ids</title><content type='html'>Today, while trying to fix broken rendering of &lt;a href="http://aero-bg.com/"&gt;aero-bg.com&lt;/a&gt; on Firefox, I delved deeper in CSS of site. Interesting though the css,  almost randomly used in some cases ids and in other classes. I almost forgot, what the difference between those selectors are, so I refreshed myself, reading this &lt;a href="http://css-discuss.incutio.com/?page=ClassesVsIds"&gt;incredible peace of info&lt;/a&gt;. To make things short, this is what are important differences:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;1. Repeated use within a document&lt;/span&gt;&lt;ul&gt;&lt;li&gt;Classes can be used as many times as needed within a document.&lt;/li&gt;&lt;li&gt;IDs can only be applied once within a document.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;So, if you need to use the same specific selector more than once, classes are a better choice.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;2. Combining class selectors&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;You can use multiple classes to style an HTML element but you can only use one ID when styling an HTML element. This means that class selectors have a wider range of applications.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;3. IDs have higher specificity than classes&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;There may be times when a declaration conflicts with another declaration. These conflicts are resolved using the Cascade rules. In simple terms, if a class selector and ID selector were to be in conflict, the ID selector would be chosen.&lt;br /&gt;&lt;br /&gt;Also &lt;a href="http://www.alistapart.com/articles/scripttriggers/"&gt;following article has it's controversal way to detach scripts for handling DOM events, from presentation.&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7542889160674991776-3758430851124795827?l=www.emil-genov.info' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://css-discuss.incutio.com/?page=ClassesVsIds' title='Classes vs. Ids'/><link rel='replies' type='application/atom+xml' href='http://www.emil-genov.info/feeds/3758430851124795827/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7542889160674991776&amp;postID=3758430851124795827' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7542889160674991776/posts/default/3758430851124795827'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7542889160674991776/posts/default/3758430851124795827'/><link rel='alternate' type='text/html' href='http://www.emil-genov.info/2007/10/classes-vs-ids.html' title='Classes vs. Ids'/><author><name>Emo</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://photos1.blogger.com/blogger/2864/364/400/EmoPic.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7542889160674991776.post-3227073024830414556</id><published>2007-10-14T10:44:00.000+03:00</published><updated>2007-10-14T10:44:39.539+03:00</updated><title type='text'>Exploits For A Mom</title><content type='html'>Recently SQL injection is a next big thing. So let's see an up side of it :)&lt;br /&gt;&lt;br /&gt;&lt;img src="http://imgs.xkcd.com/comics/exploits_of_a_mom.png" border="0" /&gt;&lt;br /&gt;&lt;br /&gt;So, do You SANITIZE?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7542889160674991776-3227073024830414556?l=www.emil-genov.info' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.emil-genov.info/feeds/3227073024830414556/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7542889160674991776&amp;postID=3227073024830414556' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7542889160674991776/posts/default/3227073024830414556'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7542889160674991776/posts/default/3227073024830414556'/><link rel='alternate' type='text/html' href='http://www.emil-genov.info/2007/10/exploits-for-mom.html' title='Exploits For A Mom'/><author><name>Emo</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://photos1.blogger.com/blogger/2864/364/400/EmoPic.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7542889160674991776.post-5860527020277530227</id><published>2007-10-14T01:33:00.001+03:00</published><updated>2010-12-22T19:41:38.963+02:00</updated><title type='text'>Top Ten Software Architecture Mistakes</title><content type='html'>I have stumble upon &lt;a href="http://www.itarchitect.co.uk/articles/display.asp?id=371"&gt;some of this mistakes&lt;/a&gt;, and some of them could be avoided just by better planning. So this are good things for me to know in my future career.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7542889160674991776-5860527020277530227?l=www.emil-genov.info' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.itarchitect.co.uk/articles/display.asp?id=371' title='Top Ten Software Architecture Mistakes'/><link rel='replies' type='application/atom+xml' href='http://www.emil-genov.info/feeds/5860527020277530227/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7542889160674991776&amp;postID=5860527020277530227' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7542889160674991776/posts/default/5860527020277530227'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7542889160674991776/posts/default/5860527020277530227'/><link rel='alternate' type='text/html' href='http://www.emil-genov.info/2007/10/top-ten-software-architecture-mistakes.html' title='Top Ten Software Architecture Mistakes'/><author><name>Emo</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://photos1.blogger.com/blogger/2864/364/400/EmoPic.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7542889160674991776.post-5192320074822133210</id><published>2007-10-09T10:21:00.000+03:00</published><updated>2007-10-23T10:25:09.393+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='pictures'/><title type='text'>Scrum stickies</title><content type='html'>&lt;div style="text-align: center;"&gt;&lt;div style="text-align: left;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp0.blogger.com/_J00sPFsIEVY/Rx2hW586K-I/AAAAAAAAB5c/IOe9r-j0V88/s1600-h/09102007.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; cursor: pointer;" src="http://bp0.blogger.com/_J00sPFsIEVY/Rx2hW586K-I/AAAAAAAAB5c/IOe9r-j0V88/s400/09102007.jpg" alt="" id="BLOGGER_PHOTO_ID_5124429365902978018" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;This is our interpretation of sticky notes task implementation. Direct on office windows. Cute :)&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7542889160674991776-5192320074822133210?l=www.emil-genov.info' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.emil-genov.info/feeds/5192320074822133210/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7542889160674991776&amp;postID=5192320074822133210' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7542889160674991776/posts/default/5192320074822133210'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7542889160674991776/posts/default/5192320074822133210'/><link rel='alternate' type='text/html' href='http://www.emil-genov.info/2007/10/this-is-our-interpretation-of-sticky.html' title='Scrum stickies'/><author><name>Emo</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://photos1.blogger.com/blogger/2864/364/400/EmoPic.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp0.blogger.com/_J00sPFsIEVY/Rx2hW586K-I/AAAAAAAAB5c/IOe9r-j0V88/s72-c/09102007.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7542889160674991776.post-8448477292931994313</id><published>2007-03-09T09:42:00.001+02:00</published><updated>2007-03-09T09:42:28.420+02:00</updated><title type='text'>Industria is in top 50 key innovators</title><content type='html'>&lt;p&gt;&lt;/p&gt; &lt;p&gt;It’s not every day that Industria(the company I work for)&amp;nbsp;is mentioned along with household names such as Adidas, BSkyB, BMW, Rolls Royce, Royal Bank of Scotland, Skype, Vodafone and Virgin Atlantic. &lt;p&gt;However, that’s just where we are in the March edition of global monthly &lt;a href="http://cnbceb.com/2007/02/15/the-innovation-issue/"&gt;CNBC European Business&lt;/a&gt;, which has named us as one of this year’s &lt;b&gt;50 key innovators&lt;/b&gt; among European companies. &lt;p&gt;Described by the panel of judges as being “&lt;b&gt;potentially one of the biggest contributors to a European future of digital convergence and IPTV&lt;/b&gt;“, Industria joins some of the world’s best-known companies on the list, which was compiled by a variety of experts on each of the ten sectors looked at. &lt;p&gt;According to the magazine, “&lt;b&gt;Industria’s ambition can be seen in its office locations: the UK, Ireland, Bulgaria and China. This Icelandic tiger specialises in software for bridging mobile and fixed-line networks, and its IPTV services platform subsidiary Zignal is creating a real stir&lt;/b&gt;.”&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7542889160674991776-8448477292931994313?l=www.emil-genov.info' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.emil-genov.info/feeds/8448477292931994313/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7542889160674991776&amp;postID=8448477292931994313' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7542889160674991776/posts/default/8448477292931994313'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7542889160674991776/posts/default/8448477292931994313'/><link rel='alternate' type='text/html' href='http://www.emil-genov.info/2007/03/industria-is-in-top-50-key-innovators.html' title='Industria is in top 50 key innovators'/><author><name>Emo</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://photos1.blogger.com/blogger/2864/364/400/EmoPic.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7542889160674991776.post-8692279883876630561</id><published>2007-02-24T17:00:00.001+02:00</published><updated>2007-02-24T17:15:58.781+02:00</updated><title type='text'>How to implement Java Web Services with XFire</title><content type='html'>&lt;p&gt;&lt;/p&gt; &lt;h3&gt;Exporting WebService with XFire&lt;/h3&gt; &lt;ul&gt; &lt;li&gt;&lt;strong&gt;Using XFire proprietary configuration file&lt;/strong&gt; - This method is simple and has a good interoperability with .Net applications. Problem is that everything is hardcoded, and can not be used Spring for wiring up the components. Should be used if other method does not give you good results (which was the case with XFire prior of version 1.2.4) &lt;/li&gt;&lt;/ul&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="2007/02/exporting-webservice-using-xfire-with_2112.html"&gt;&lt;strong&gt;Using XFire with Spring&lt;/strong&gt;&lt;/a&gt; - this is 'semi-automatic' way. It still gives us power of entirely Spring configured WS, without problems that we have with fully automated JSR181 annotation approach &lt;/li&gt;&lt;/ul&gt; &lt;ul&gt; &lt;li&gt;&lt;strong&gt;&lt;img height="16" src="http://bp1.blogger.com/_J00sPFsIEVY/ReBWVrJFljI/AAAAAAAABGE/BfOwwT-kqF4/s320/forbidden.gif" width="16"&gt; &lt;a href="2007/02/exporting-webservice-using-xfire-with_5058.html"&gt;Using XFire with Spring and JSR181 Annotations&lt;/a&gt;&lt;/strong&gt;&lt;/a&gt; - very powerfull way. Has advantage, that is independent of XFire. Compatible with JAX-WS java standard for WS. Integrates smootly with Spring. No manual operations, completely automatic. Beautiful &lt;/li&gt;&lt;/ul&gt; &lt;h3&gt;&lt;a&gt;&lt;/a&gt;Creating WebService Implementation&lt;/h3&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="2007/02/creating-ws-from-scratch.html"&gt;&lt;strong&gt;Creating New WebService From Scratch&lt;/strong&gt;&lt;/a&gt; - here we make interface and implementation, annotate them and deploy them to XFire  &lt;li&gt;&lt;a href="2007/02/creating-ws-from-wsdl-file.html"&gt;&lt;strong&gt;Creating WebService from WSDL&lt;/strong&gt;&lt;/a&gt; - describes usage of wsgen XFire tool, for automatic generation of java classes from WSDL &lt;/li&gt;&lt;/ul&gt; &lt;h3&gt;&lt;a&gt;&lt;/a&gt;&lt;a&gt;&lt;/a&gt;Specifics&lt;/h3&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="2007/02/inheritance-and-xfire.html"&gt;Inheritance and XFire&lt;/a&gt;  &lt;li&gt;&lt;a href=""&gt;Viewing SOAP requests &amp;amp; responses&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt; &lt;h3&gt;&lt;a&gt;&lt;/a&gt;Additional Reading&lt;/h3&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://docs.codehaus.org/display/XFIRE/Spring+QuickStart+Guide"&gt;XFire + Spring quick start guide&lt;/a&gt;  &lt;li&gt;&lt;a href="http://xfire.codehaus.org/Client+and+Server+Stub+Generation+from+WSDL"&gt;Client and Server Stub Generation from WSDL&lt;/a&gt;  &lt;li&gt;&lt;a href="http://xfire.codehaus.org/Download"&gt;XFire download&lt;/a&gt;  &lt;li&gt;&lt;a href="http://www.springframework.org/docs/reference/remoting.html"&gt;Remoting and web services using Spring&lt;/a&gt;  &lt;li&gt;&lt;a href="http://www.memestorm.com/blog/basic-spring-web-services-with-xfire-and-jsr-181/"&gt;Basic Spring Web services with XFire and JSR 181&lt;/a&gt;  &lt;li&gt;&lt;a href="http://www.w3.org/TR/REC-xml-names/"&gt;Namespaces in XML 1.0&lt;/a&gt;  &lt;li&gt;&lt;a href="http://ftpna2.bea.com/pub/downloads/JSR181-fr-1.pdf"&gt;JSR 181 Spec&lt;/a&gt;  &lt;li&gt;&lt;a href="http://xfire.codehaus.org/Client+API"&gt;XFire client building&lt;/a&gt;  &lt;li&gt;Installation of Eclipse XFire Plugin - Add the following URL &lt;a href="http://dist.codehaus.org/xfire/update/"&gt;http://dist.codehaus.org/xfire/update/&lt;/a&gt; to Help -&amp;gt; Software Updates -&amp;gt; Find and Install &lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7542889160674991776-8692279883876630561?l=www.emil-genov.info' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.emil-genov.info/feeds/8692279883876630561/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7542889160674991776&amp;postID=8692279883876630561' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7542889160674991776/posts/default/8692279883876630561'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7542889160674991776/posts/default/8692279883876630561'/><link rel='alternate' type='text/html' href='http://www.emil-genov.info/2007/02/how-to-implement-java-web-services-with.html' title='How to implement Java Web Services with XFire'/><author><name>Emo</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://photos1.blogger.com/blogger/2864/364/400/EmoPic.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp1.blogger.com/_J00sPFsIEVY/ReBWVrJFljI/AAAAAAAABGE/BfOwwT-kqF4/s72-c/forbidden.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7542889160674991776.post-4673163137567042308</id><published>2007-02-24T16:48:00.001+02:00</published><updated>2007-02-24T16:48:17.032+02:00</updated><title type='text'>Inheritance and XFire</title><content type='html'>&lt;p&gt;&lt;/p&gt; &lt;p&gt;Sometimes we need to use polymorphism and it is already supported by WSDL, so here is a little tricky explanation how to do this using XFire. &lt;p&gt;For example we have a basic type &lt;em&gt;Party&lt;/em&gt; and two classes that extend it: &lt;em&gt;Individual&lt;/em&gt; and &lt;em&gt;Organisation&lt;/em&gt;. We define method in interface, that accepts Party, but we need to be possible to use Individual and Organisation objects with this method too. This is solved by adding following annotations to &lt;em&gt;implementation of service&lt;/em&gt;: &lt;blockquote&gt;&lt;pre&gt;@WebService(serviceName = "PartyProcessImpl", endpointInterface = "com.industria.PartyProcess")&lt;br /&gt;@ServiceProperties(properties={&lt;br /&gt;  @ServiceProperty(key=AegisBindingProvider.WRITE_XSI_TYPE_KEY, value="true"),&lt;br /&gt;  @ServiceProperty(key=AegisBindingProvider.OVERRIDE_TYPES_KEY, list={"com.party.Individual","com.party.Organisation"})&lt;br /&gt;  })&lt;br /&gt;public class PartyProcessImpl implements PartyProcess {&lt;/pre&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;p&gt;basically in second @ServiceProperty annotations, we give a list of classes, that need to be check if override some of basic types that are used into WS interface.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7542889160674991776-4673163137567042308?l=www.emil-genov.info' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.emil-genov.info/feeds/4673163137567042308/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7542889160674991776&amp;postID=4673163137567042308' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7542889160674991776/posts/default/4673163137567042308'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7542889160674991776/posts/default/4673163137567042308'/><link rel='alternate' type='text/html' href='http://www.emil-genov.info/2007/02/inheritance-and-xfire.html' title='Inheritance and XFire'/><author><name>Emo</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://photos1.blogger.com/blogger/2864/364/400/EmoPic.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7542889160674991776.post-8530311145139829426</id><published>2007-02-24T16:46:00.001+02:00</published><updated>2007-02-24T16:46:34.466+02:00</updated><title type='text'>Creating WS from an WSDL file</title><content type='html'>&lt;p&gt;If you must use preexisting WSDL file, You can use tool in XFire to generate you an Java implementation of it. It's like issuing this ant script: &lt;blockquote&gt;&lt;pre&gt;&amp;lt;target name="wsdl" depends="createDirs"&amp;gt;&lt;br /&gt;  &amp;lt;path id="xfire-classpath"&amp;gt;&lt;br /&gt;   &amp;lt;fileset dir="${libDir}/xfire"&amp;gt;&lt;br /&gt;    &amp;lt;include name="*.jar" /&amp;gt;&lt;br /&gt;   &amp;lt;/fileset&amp;gt;&lt;br /&gt;  &amp;lt;/path&amp;gt;&lt;br /&gt;&lt;br /&gt;  &amp;lt;taskdef name="wsgen" classname="org.codehaus.xfire.gen.WsGenTask"&lt;br /&gt;        classpathref="xfire-classpath"/&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;  &amp;lt;wsgen outputDirectory="${basedir}/target/generated-source"&lt;br /&gt;     wsdl="${basedir}/src/com/industria/tea/soap/TaskEscalation.wsdl" package="com.industria.tea.soap" overwrite="true"/&amp;gt;&lt;br /&gt; &amp;lt;/target&amp;gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;p&gt;where $libDir/xfire contains all jars taken from XFire distribution to avoid version mismatch&lt;br /&gt;&lt;p&gt;where:&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;wsdl&lt;/b&gt; - location of wsdl file ( can be any valid url ) &lt;br /&gt;&lt;li&gt;&lt;b&gt;outputDirectory&lt;/b&gt; - output directory for generated classes &lt;br /&gt;&lt;li&gt;&lt;b&gt;package&lt;/b&gt; - package where client code will be placed &lt;br /&gt;&lt;li&gt;&lt;b&gt;overwrite&lt;/b&gt; - allows to overwrite previously generated classes ( without this option, generator will refuse to generate classes if such already exists ) &lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7542889160674991776-8530311145139829426?l=www.emil-genov.info' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.emil-genov.info/feeds/8530311145139829426/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7542889160674991776&amp;postID=8530311145139829426' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7542889160674991776/posts/default/8530311145139829426'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7542889160674991776/posts/default/8530311145139829426'/><link rel='alternate' type='text/html' href='http://www.emil-genov.info/2007/02/creating-ws-from-wsdl-file.html' title='Creating WS from an WSDL file'/><author><name>Emo</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://photos1.blogger.com/blogger/2864/364/400/EmoPic.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7542889160674991776.post-1822167482436305828</id><published>2007-02-24T16:37:00.001+02:00</published><updated>2007-02-24T16:44:10.219+02:00</updated><title type='text'>Creating WS from scratch</title><content type='html'>&lt;p&gt;&lt;/p&gt; &lt;p&gt;In this case we just create our Java interface and implementation and annotate them with JSR-181 annotations. After this WSDL can be retrieved by going to http://&amp;lt;server_name&amp;gt;:8080/&amp;lt;war_name&amp;gt;/services/&amp;lt;serviceName&amp;gt;?wsdl  &lt;p&gt;Here is a step-by-step manual for doing this:  &lt;ol&gt; &lt;li&gt;First start as &lt;b&gt;normal POJO&lt;/b&gt; object that implements functionality you need to expose as WS:  &lt;blockquote&gt;&lt;pre&gt;package com.industria.order.validation;&lt;br /&gt;&lt;br /&gt;public class AllocatedResourceVerificationImpl implements AllocatedResourceVerification{&lt;br /&gt;&lt;br /&gt;	public void validate(String resourceId, String resourceName, String resourceValue) throws ValidationException{&lt;br /&gt;		log.info("Invoked: "+resourceName);&lt;br /&gt;	}&lt;br /&gt;}&lt;/pre&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;li&gt;Extract all functions needed into &lt;b&gt;interface&lt;/b&gt;, this helps separate implementation from definition, and is always a good thing (TM) to program to interfaces, so we have &lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;package com.industria.order.validation;&lt;br /&gt;&lt;br /&gt;public interface AllocatedResourceVerification {&lt;br /&gt;&lt;br /&gt;    public void validate(String resourceId,String resourceName,String resourceValue) throws ValidationException;&lt;br /&gt;}&lt;/pre&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;package com.industria.order.validation;&lt;br /&gt;&lt;br /&gt;public class AllocatedResourceVerificationImpl implements AllocatedResourceVerification{&lt;br /&gt;&lt;br /&gt;	public void validate(String resourceId, String resourceName, String resourceValue) throws ValidationException{&lt;br /&gt;		log.info("Invoked: "+resourceName);&lt;br /&gt;	}&lt;br /&gt;}&lt;/pre&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;Anotate interface&lt;/b&gt; - this is needed only if we gonna use XFire automatic handling of JSR181 annotated classes (see &lt;a href="2007/02/exporting-webservice-using-xfire-with_5058.html"&gt;Exporting WebService - Using XFire with Spring and JSR181 Annotations&lt;/a&gt;) &lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;Anotate interface with a &lt;b&gt;@WebService&lt;/b&gt; anotation, the only nessesary parameter is &lt;b&gt;targetNamespace&lt;/b&gt;, &lt;br /&gt;&lt;li&gt;Anotate each method you want to expose with &lt;b&gt;@WebMethod&lt;/b&gt; anotation &lt;br /&gt;&lt;li&gt;If you want parameter of operations to have a names in WSDL, anotate them with &lt;b&gt;@WebParam&lt;/b&gt; &lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;package com.industria.order.validation;&lt;br /&gt;&lt;br /&gt;import javax.jws.WebMethod;&lt;br /&gt;import javax.jws.WebParam;&lt;br /&gt;import javax.jws.WebService;&lt;br /&gt;&lt;br /&gt;@WebService(targetNamespace = "http://www.industria.com/contracts/Addons/Salesforce/OrderManager")&lt;br /&gt;public interface AllocatedResourceVerification {&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    @WebMethod&lt;br /&gt;    public void validate(@WebParam(name = "resourceId")String resourceId,&lt;br /&gt;    		@WebParam(name = "resourceName")String resourceName,&lt;br /&gt;    		@WebParam(name = "resourceValue")String resourceValue) throws ValidationException;&lt;br /&gt;}&lt;/pre&gt;&lt;/blockquote&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;li&gt;&lt;strong&gt;Anotate implementaion&lt;/strong&gt; &lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;You must put @WebService anotation &lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;giving &lt;b&gt;serviceName&lt;/b&gt; - this is name with which this service will be exported by XFire &lt;br /&gt;&lt;li&gt;and &lt;b&gt;endpointInterface&lt;/b&gt; - this is pointer to the interface we implement &lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;package com.industria.order.validation;&lt;br /&gt;&lt;br /&gt;import javax.jws.WebService;&lt;br /&gt;&lt;br /&gt;import org.apache.commons.logging.Log;&lt;br /&gt;import org.apache.commons.logging.LogFactory;&lt;br /&gt;&lt;br /&gt;@WebService(serviceName = "AllocatedResourceVerification",&lt;br /&gt;			endpointInterface = "com.industria.order.validation.AllocatedResourceVerification")&lt;br /&gt;public class AllocatedResourceVerificationImpl implements AllocatedResourceVerification{&lt;br /&gt;&lt;br /&gt;	protected static final Log log = LogFactory.getLog(AllocatedResourceVerificationImpl.class);&lt;br /&gt;&lt;br /&gt;	public void validate(String resourceId, String resourceName, String resourceValue) throws ValidationException{&lt;br /&gt;		log.info("Invoked: "+resourceName);&lt;br /&gt;	}&lt;br /&gt;}&lt;/pre&gt;&lt;/blockquote&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7542889160674991776-1822167482436305828?l=www.emil-genov.info' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.emil-genov.info/feeds/1822167482436305828/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7542889160674991776&amp;postID=1822167482436305828' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7542889160674991776/posts/default/1822167482436305828'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7542889160674991776/posts/default/1822167482436305828'/><link rel='alternate' type='text/html' href='http://www.emil-genov.info/2007/02/creating-ws-from-scratch.html' title='Creating WS from scratch'/><author><name>Emo</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://photos1.blogger.com/blogger/2864/364/400/EmoPic.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7542889160674991776.post-5404802588224496862</id><published>2007-02-24T16:27:00.001+02:00</published><updated>2007-02-24T16:38:46.038+02:00</updated><title type='text'>Exporting WebService - Using XFire with Spring</title><content type='html'>&lt;p&gt;&lt;/p&gt; &lt;h2&gt;Project structure and contents&lt;/h2&gt; &lt;p&gt;Template project is attached to this page, feel free to use it and update it.  &lt;p&gt;As all Java WS are deployed as WAR file, at some point your project must create one. Here some guidelines how to have a one that works:  &lt;ul&gt; &lt;li&gt;In &lt;b&gt;WEB-INF/web.xml&lt;/b&gt; file, XFireSpring servlet is instantiated. For it's parameter contextConfigLocation, we specify spring config file that will be discussed in next step. Mappings are usual one, this file is same as the one used for working of Spring with XFire:  &lt;blockquote&gt;&lt;pre&gt;&amp;lt;?xml version="1.0" encoding="ISO-8859-1"?&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;web-app xmlns="http://java.sun.com/xml/ns/j2ee"&lt;br /&gt;	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&lt;br /&gt;	xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"&lt;br /&gt;	version="2.4"&amp;gt;&lt;br /&gt;&lt;br /&gt;	&amp;lt;display-name&amp;gt;XFire&amp;lt;/display-name&amp;gt;&lt;br /&gt;&lt;br /&gt;	&amp;lt;context-param&amp;gt;&lt;br /&gt;		&amp;lt;param-name&amp;gt;contextConfigLocation&amp;lt;/param-name&amp;gt;                   (1)&lt;br /&gt;		&amp;lt;param-value&amp;gt;classpath:xfire-servlet.xml&amp;lt;/param-value&amp;gt;&lt;br /&gt;	&amp;lt;/context-param&amp;gt;&lt;br /&gt;&lt;br /&gt;	&amp;lt;servlet&amp;gt;&lt;br /&gt;		&amp;lt;servlet-name&amp;gt;XFireServlet&amp;lt;/servlet-name&amp;gt;                        (2)&lt;br /&gt;		&amp;lt;display-name&amp;gt;XFire Servlet&amp;lt;/display-name&amp;gt;&lt;br /&gt;		&amp;lt;servlet-class&amp;gt;&lt;br /&gt;			org.codehaus.xfire.spring.XFireSpringServlet&lt;br /&gt;		&amp;lt;/servlet-class&amp;gt;&lt;br /&gt;	&amp;lt;/servlet&amp;gt;&lt;br /&gt;&lt;br /&gt;	&amp;lt;servlet-mapping&amp;gt;&lt;br /&gt;		&amp;lt;servlet-name&amp;gt;XFireServlet&amp;lt;/servlet-name&amp;gt;                        (3)&lt;br /&gt;		&amp;lt;url-pattern&amp;gt;/servlet/XFireServlet/*&amp;lt;/url-pattern&amp;gt;&lt;br /&gt;	&amp;lt;/servlet-mapping&amp;gt;&lt;br /&gt;&lt;br /&gt;	&amp;lt;servlet-mapping&amp;gt;&lt;br /&gt;		&amp;lt;servlet-name&amp;gt;XFireServlet&amp;lt;/servlet-name&amp;gt;&lt;br /&gt;		&amp;lt;url-pattern&amp;gt;/services/*&amp;lt;/url-pattern&amp;gt;&lt;br /&gt;	&amp;lt;/servlet-mapping&amp;gt;&lt;br /&gt;&lt;br /&gt;	&amp;lt;listener&amp;gt;&lt;br /&gt;		&amp;lt;listener-class&amp;gt;&lt;br /&gt;			org.springframework.web.context.ContextLoaderListener    (4)&lt;br /&gt;		&amp;lt;/listener-class&amp;gt;&lt;br /&gt;	&amp;lt;/listener&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/web-app&amp;gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;(1) Defines that file &lt;b&gt;xfire-servlet.xml&lt;/b&gt;, will be automatically available to Spring. Will define this in next section. &lt;br /&gt;&lt;li&gt;(2) Define XFireServlet &lt;br /&gt;&lt;li&gt;(3) Map it to &lt;b&gt;XXX/services/... path&lt;/b&gt;, where &lt;b&gt;XXX&lt;/b&gt; will be &lt;b&gt;WAR&lt;/b&gt; name &lt;br /&gt;&lt;li&gt;(4) Add context listener, so Spring will auto-load xfire-servlet.xml file, see &lt;a href="http://www.springframework.org/docs/api/org/springframework/web/context/ContextLoaderListener.html"&gt;Spring documentation for more detail&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;Create spring config file (I have named it &lt;b&gt;xfire-servlet.xml&lt;/b&gt;) for configuring XFire services. Put it in classpath. &lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&lt;br /&gt;&amp;lt;!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"&amp;gt;&lt;br /&gt;&amp;lt;beans&amp;gt;&lt;br /&gt;	&amp;lt;bean id="jaxbServiceFactory" class="org.codehaus.xfire.jaxb2.JaxbServiceFactory" /&amp;gt;              (1)&lt;br /&gt;	&amp;lt;import resource="classpath:org/codehaus/xfire/spring/xfire.xml" /&amp;gt;                               (2)&lt;br /&gt;	&amp;lt;import resource="classpath:webservices.xml" /&amp;gt;                                                   (3)&lt;br /&gt;&amp;lt;/beans&amp;gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;(1) Defines JaxbFactory that will be used by all service exporters &lt;br /&gt;&lt;li&gt;(2) Includes XFire internal (in xfire.jar) spring configuration &lt;br /&gt;&lt;li&gt;(3) Includes our spring configuration file, in which we will define our exporter/implementation class pairs, for each WS we want to build. This is discussed in next paragraph. &lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;Create spring config file (&lt;b&gt;webservice.xml&lt;/b&gt;) for instantiation of service implementations and exporters: &lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&lt;br /&gt;&amp;lt;!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"&amp;gt;&lt;br /&gt;&amp;lt;beans&amp;gt;&lt;br /&gt;	&amp;lt;bean id="XFireContractFirst" class="org.example.xfirecontractfirst.XfireContractFirstImpl" /&amp;gt;	   (1)&lt;br /&gt;	&amp;lt;bean name="XFireContractFirstService" class="org.codehaus.xfire.spring.ServiceBean"&amp;gt;              (2)&lt;br /&gt;		&amp;lt;property name="serviceBean" ref="XFireContractFirst" /&amp;gt;&lt;br /&gt;		&amp;lt;property name="serviceClass" value="org.example.xfirecontractfirst.XfireContractFirst" /&amp;gt; (3)&lt;br /&gt;		&amp;lt;property name="serviceFactory"&amp;gt;&amp;lt;ref bean="jaxbServiceFactory"/&amp;gt;&amp;lt;/property&amp;gt;                (4)&lt;br /&gt;	&amp;lt;/bean&amp;gt;&lt;br /&gt;&amp;lt;/beans&amp;gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;(1) This is instantiation of WS implementation class &lt;br /&gt;&lt;li&gt;(2) This is instantiation of exporter &lt;br /&gt;&lt;li&gt;(3) Which has parameters of implementation bean and service interface &lt;br /&gt;&lt;li&gt;(4) Must use JAXB2 binding in order to have interoperability with .Net clients &lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;In lib folder You should have following jars: &lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;xfire-all-1.2.4.jar &lt;br /&gt;&lt;li&gt;xfire-jsr181-api-1.0-M1.jar &lt;br /&gt;&lt;li&gt;activation.jar &lt;br /&gt;&lt;li&gt;commons-logging-1.0.4.jar &lt;br /&gt;&lt;li&gt;mail-1.4.jar &lt;br /&gt;&lt;li&gt;jdom-1.0.jar &lt;br /&gt;&lt;li&gt;stax-api-1.0.1.jar &lt;br /&gt;&lt;li&gt;wsdl4j-1.5.2.jar &lt;br /&gt;&lt;li&gt;wstx-asl-3.0.1.jar &lt;br /&gt;&lt;li&gt;log4j-1.2.8.jar &lt;br /&gt;&lt;li&gt;spring.jar &lt;br /&gt;&lt;li&gt;XmlSchema-1.1.jar &lt;br /&gt;&lt;li&gt;jaxb-api-2.0.jar &lt;br /&gt;&lt;li&gt;jaxb-impl-2.0.1.jar &lt;br /&gt;&lt;li&gt;jaxb-xjc-2.0.1.jar (only for generation of java classes from WSDL, not needed to be in WAR file, after that) &lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;If you gonna run under Java 1.4, make sure to remove annotations that wsgen have putted in java code generated from WSDL. Also remove xfire-jsr181-api-1.0-M1.jar from classpath. &lt;br /&gt;&lt;li&gt;For creating WAR this ant code fragment could be used: &lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;&amp;lt;war warfile="webservice.war" webxml="webcontent/web.xml"&amp;gt;&lt;br /&gt;	&amp;lt;zipfileset dir="lib" prefix="WEB-INF/lib" /&amp;gt;&lt;br /&gt;	&amp;lt;zipfileset dir="bin" prefix="WEB-INF/classes"/&amp;gt;&lt;br /&gt;&amp;lt;/war&amp;gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;h2&gt;&lt;a&gt;&lt;/a&gt;&amp;nbsp;&lt;/h2&gt;&lt;br /&gt;&lt;h2&gt;Adding a new WS&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;Once you have all this plumbing code set in place, adding a new WS is just a song: &lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;Just create interface and implentation of service &lt;br /&gt;&lt;li&gt;Create implementation and exporter beans in webservices.xml file &lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;h2&gt;&amp;nbsp;&lt;/h2&gt;&lt;br /&gt;&lt;h2&gt;Example project&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;All this can be seen in attached &lt;a href="https://wiki.industria.com:8443/download/attachments/19592/ws-example.zip?version=1"&gt;example ws project&lt;/a&gt;. Just unpack it, add needed libs (see for list up) from current (version &amp;gt;= 1.2.4) XFire distribution, and run &lt;b&gt;ant&lt;/b&gt; which will &lt;/p&gt;&lt;br /&gt;&lt;p&gt;create WS implementation classes from WSDL, compile them and generates WAR file. Deploy this file to Application server and test deployed WS.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7542889160674991776-5404802588224496862?l=www.emil-genov.info' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.emil-genov.info/feeds/5404802588224496862/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7542889160674991776&amp;postID=5404802588224496862' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7542889160674991776/posts/default/5404802588224496862'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7542889160674991776/posts/default/5404802588224496862'/><link rel='alternate' type='text/html' href='http://www.emil-genov.info/2007/02/exporting-webservice-using-xfire-with_2112.html' title='Exporting WebService - Using XFire with Spring'/><author><name>Emo</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://photos1.blogger.com/blogger/2864/364/400/EmoPic.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7542889160674991776.post-4722824117018617332</id><published>2007-02-24T15:44:00.001+02:00</published><updated>2007-02-24T15:48:10.576+02:00</updated><title type='text'>Exporting WebService - Using XFire with Spring and JSR181 Annotations</title><content type='html'>&lt;p&gt;&lt;img height="16" alt="" src="https://wiki.industria.com:8443/images/icons/emoticons/forbidden.gif" width="16" align="absMiddle" border="0"&gt;&amp;nbsp;&lt;b&gt;NOT WORKING&lt;/b&gt; &lt;br&gt;This still does not work, look at &lt;a href="http://jira.codehaus.org/browse/XFIRE-715?page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel"&gt;Codehaus issue&lt;/a&gt;, when this is resolved is worth trying again  &lt;p&gt;&amp;nbsp;  &lt;h2&gt;Project structure and contents&lt;/h2&gt; &lt;p&gt;Template project is attached to this page, feel free to use it and update it.  &lt;p&gt;As all Java WS are deployed as WAR file, at some point your project must create one. Here some guidelines how to have a one that works:  &lt;ul&gt; &lt;li&gt;In &lt;b&gt;WEB-INF/web.xml&lt;/b&gt; file, XFireSpring servlet is instantiated. For it's parameter contextConfigLocation, we specify spring config file that will be discussed in next step. Mappings are usual one, this file is same as the one used for working of Spring with XFire:  &lt;blockquote&gt;&lt;pre&gt;&amp;lt;?xml version="1.0" encoding="ISO-8859-1"?&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;web-app xmlns="http://java.sun.com/xml/ns/j2ee"&lt;br /&gt;	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&lt;br /&gt;	xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"&lt;br /&gt;	version="2.4"&amp;gt;&lt;br /&gt;&lt;br /&gt;	&amp;lt;display-name&amp;gt;XFire&amp;lt;/display-name&amp;gt;&lt;br /&gt;&lt;br /&gt;	&amp;lt;context-param&amp;gt;&lt;br /&gt;		&amp;lt;param-name&amp;gt;contextConfigLocation&amp;lt;/param-name&amp;gt;                   (1)&lt;br /&gt;		&amp;lt;param-value&amp;gt;classpath:xfire-servlet.xml&amp;lt;/param-value&amp;gt;&lt;br /&gt;	&amp;lt;/context-param&amp;gt;&lt;br /&gt;&lt;br /&gt;	&amp;lt;servlet&amp;gt;&lt;br /&gt;		&amp;lt;servlet-name&amp;gt;XFireServlet&amp;lt;/servlet-name&amp;gt;                        (2)&lt;br /&gt;		&amp;lt;display-name&amp;gt;XFire Servlet&amp;lt;/display-name&amp;gt;&lt;br /&gt;		&amp;lt;servlet-class&amp;gt;&lt;br /&gt;			org.codehaus.xfire.spring.XFireSpringServlet&lt;br /&gt;		&amp;lt;/servlet-class&amp;gt;&lt;br /&gt;	&amp;lt;/servlet&amp;gt;&lt;br /&gt;&lt;br /&gt;	&amp;lt;servlet-mapping&amp;gt;&lt;br /&gt;		&amp;lt;servlet-name&amp;gt;XFireServlet&amp;lt;/servlet-name&amp;gt;                        (3)&lt;br /&gt;		&amp;lt;url-pattern&amp;gt;/servlet/XFireServlet/*&amp;lt;/url-pattern&amp;gt;&lt;br /&gt;	&amp;lt;/servlet-mapping&amp;gt;&lt;br /&gt;&lt;br /&gt;	&amp;lt;servlet-mapping&amp;gt;&lt;br /&gt;		&amp;lt;servlet-name&amp;gt;XFireServlet&amp;lt;/servlet-name&amp;gt;&lt;br /&gt;		&amp;lt;url-pattern&amp;gt;/services/*&amp;lt;/url-pattern&amp;gt;&lt;br /&gt;	&amp;lt;/servlet-mapping&amp;gt;&lt;br /&gt;&lt;br /&gt;	&amp;lt;listener&amp;gt;&lt;br /&gt;		&amp;lt;listener-class&amp;gt;&lt;br /&gt;			org.springframework.web.context.ContextLoaderListener    (4)&lt;br /&gt;		&amp;lt;/listener-class&amp;gt;&lt;br /&gt;	&amp;lt;/listener&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/web-app&amp;gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;(1) Defines that file &lt;b&gt;xfire-servlet.xml&lt;/b&gt;, will be automatically available to Spring. Will define this in next section. &lt;br /&gt;&lt;li&gt;(2) Define XFireServlet &lt;br /&gt;&lt;li&gt;(3) Map it to &lt;b&gt;XXX/services/... path&lt;/b&gt;, where &lt;b&gt;XXX&lt;/b&gt; will be &lt;b&gt;WAR&lt;/b&gt; name &lt;br /&gt;&lt;li&gt;(4) Add context listener, so Spring will auto-load xfire-servlet.xml file, see &lt;a href="http://www.springframework.org/docs/api/org/springframework/web/context/ContextLoaderListener.html"&gt;Spring documentation for more detail&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;Create Spring file (I have named it &lt;b&gt;xfire-servlet.xml&lt;/b&gt;) for configuring XFire services. Put it in classpath. &lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&lt;br /&gt;&amp;lt;!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"&amp;gt;&lt;br /&gt;&amp;lt;beans&amp;gt;&lt;br /&gt;&lt;br /&gt;	&amp;lt;bean id="webAnnotations"&lt;br /&gt;		class="org.codehaus.xfire.annotations.jsr181.Jsr181WebAnnotations" /&amp;gt;        (1)&lt;br /&gt;	&amp;lt;bean id="handlerMapping"&lt;br /&gt;		class="org.codehaus.xfire.spring.remoting.Jsr181HandlerMapping"&amp;gt;             (2)&lt;br /&gt;		&amp;lt;property name="typeMappingRegistry"&amp;gt;&lt;br /&gt;			&amp;lt;ref bean="typeMappingRegistry" /&amp;gt;&lt;br /&gt;		&amp;lt;/property&amp;gt;&lt;br /&gt;		&amp;lt;property name="xfire"&amp;gt;&lt;br /&gt;			&amp;lt;ref bean="xfire" /&amp;gt;&lt;br /&gt;		&amp;lt;/property&amp;gt;&lt;br /&gt;		&amp;lt;property name="webAnnotations"&amp;gt;&lt;br /&gt;			&amp;lt;ref bean="webAnnotations" /&amp;gt;&lt;br /&gt;		&amp;lt;/property&amp;gt;&lt;br /&gt;	&amp;lt;/bean&amp;gt;&lt;br /&gt;&lt;br /&gt;	&amp;lt;bean&lt;br /&gt;		class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"&amp;gt;&lt;br /&gt;		&amp;lt;property name="urlMap"&amp;gt;&lt;br /&gt;			&amp;lt;map&amp;gt;&lt;br /&gt;				&amp;lt;entry key="/"&amp;gt;&lt;br /&gt;					&amp;lt;ref bean="handlerMapping" /&amp;gt;&lt;br /&gt;				&amp;lt;/entry&amp;gt;&lt;br /&gt;			&amp;lt;/map&amp;gt;&lt;br /&gt;		&amp;lt;/property&amp;gt;&lt;br /&gt;	&amp;lt;/bean&amp;gt;&lt;br /&gt;&lt;br /&gt;	&amp;lt;bean id="typeMappingRegistry"&lt;br /&gt;		class="org.codehaus.xfire.jaxb2.JaxbTypeRegistry"                            (3)&lt;br /&gt;		init-method="createDefaultMappings" singleton="true"&amp;gt;&lt;br /&gt;	&amp;lt;/bean&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;	&amp;lt;import resource="classpath:org/codehaus/xfire/spring/xfire.xml" /&amp;gt;                  (4)&lt;br /&gt;	&amp;lt;import resource="classpath:webservices.xml" /&amp;gt;                                      (5)&lt;br /&gt;&amp;lt;/beans&amp;gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;(1) Defines usage JSR 181 Anotations &lt;br /&gt;&lt;li&gt;(2) Defines same for mapping &lt;br /&gt;&lt;li&gt;(3) Defines usage of JAXB2. This is very important. Without it XFire will use AEGIS binding, which gives unpleasant effects of creating non-existent namespaces for schema element with unbounded type in WSDL &lt;br /&gt;&lt;li&gt;(4) Includes xfire.xml spring configuration file residing in xfire-all.jar &lt;br /&gt;&lt;li&gt;(5) Includes our own spring configuration file which defines all beans that will be exposed as service. The same will be done for every bean instantiated by Spring, that is JSR 181 anotated, so this file is not strictly needed, but is good to group all WS implementation beans instantiations in same configuration file. This is discussed in next paragraph. &lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;Create spring config file (&lt;b&gt;webservice.xml&lt;/b&gt;) for instantiation of service implementations and exporters: &lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&lt;br /&gt;&amp;lt;!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"&amp;gt;&lt;br /&gt;&amp;lt;beans&amp;gt;&lt;br /&gt;        &amp;lt;bean id="XfireContractFirst" class="org.example.xfirecontractfirst.XfireContractFirstImpl" /&amp;gt; (1)&lt;br /&gt;&amp;lt;/beans&amp;gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;p&gt;(1) This is instantiation of WS implementation class, which must have &lt;a href="http://ftpna2.bea.com/pub/downloads/JSR181-fr-1.pdf"&gt;JSR-181 Annotations&lt;/a&gt; in it.&lt;/p&gt;&lt;br /&gt;&lt;li&gt;In lib folder You should have following jars: &lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;xfire-all-1.2.2.jar &lt;br /&gt;&lt;li&gt;xfire-jsr181-api-1.0-M1.jar &lt;br /&gt;&lt;li&gt;activation.jar &lt;br /&gt;&lt;li&gt;commons-logging-1.0.4.jar &lt;br /&gt;&lt;li&gt;mailapi_1_3_1.jar &lt;br /&gt;&lt;li&gt;jdom-1.0.jar &lt;br /&gt;&lt;li&gt;stax-api-1.0.1.jar &lt;br /&gt;&lt;li&gt;wsdl4j-1.5.1.jar &lt;br /&gt;&lt;li&gt;wstx-lgpl-3.0.2.jar &lt;br /&gt;&lt;li&gt;log4j-1.2.8.jar &lt;br /&gt;&lt;li&gt;spring.jar &lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;li&gt;Make sure that server runs &lt;b&gt;Java 5&lt;/b&gt;, because of use of annotations &lt;br /&gt;&lt;li&gt;For creating WAR this ant code fragment could be used: &lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;&amp;lt;war warfile="webservice.war" webxml="webcontent/web.xml"&amp;gt;&lt;br /&gt;	&amp;lt;zipfileset dir="lib" prefix="WEB-INF/lib" /&amp;gt;&lt;br /&gt;	&amp;lt;zipfileset dir="bin" prefix="WEB-INF/classes"/&amp;gt;&lt;br /&gt;&amp;lt;/war&amp;gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;h2&gt;&lt;a&gt;&lt;/a&gt;&amp;nbsp;&lt;/h2&gt;&lt;br /&gt;&lt;h2&gt;Adding a new WS&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;Once you have all this plumbing code set in place, adding a new WS is just a song: &lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;Just create interface and implentation of service &lt;br /&gt;&lt;li&gt;Annotate them with &lt;a href="http://ftpna2.bea.com/pub/downloads/JSR181-fr-1.pdf"&gt;JSR-181 annotations&lt;/a&gt; &lt;br /&gt;&lt;li&gt;And add a line in webservices.xml file &lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;p&gt;It's simple as that &lt;br /&gt;&lt;p&gt;&amp;nbsp; &lt;br /&gt;&lt;h2&gt;&lt;a&gt;&lt;/a&gt;Example project&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;All this can be seen in attached &lt;a href="https://wiki.industria.com:8443/download/attachments/19256/ws+with+jsr181+-+example.zip?version=1"&gt;example ws project&lt;/a&gt;. Just unpack it, add needed libs (see for list up) from current (version &amp;gt;= 1.2.4) XFire distribution, and run &lt;b&gt;ant&lt;/b&gt; which will create WS implementation classes from WSDL, compile them and generates WAR file. Deploy this file to Application server and test deployed WS.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7542889160674991776-4722824117018617332?l=www.emil-genov.info' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.emil-genov.info/feeds/4722824117018617332/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7542889160674991776&amp;postID=4722824117018617332' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7542889160674991776/posts/default/4722824117018617332'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7542889160674991776/posts/default/4722824117018617332'/><link rel='alternate' type='text/html' href='http://www.emil-genov.info/2007/02/exporting-webservice-using-xfire-with_5058.html' title='Exporting WebService - Using XFire with Spring and JSR181 Annotations'/><author><name>Emo</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://photos1.blogger.com/blogger/2864/364/400/EmoPic.jpg'/></author><thr:total>0</thr:total></entry></feed>
