<?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/"
	>

<channel>
	<title>jPOS.org &#187; admin</title>
	<atom:link href="http://jpos.org/blog/author/administrator/feed/" rel="self" type="application/rss+xml" />
	<link>http://jpos.org/blog</link>
	<description>jPOS rants, propaganda and some useful stuff.</description>
	<lastBuildDate>Wed, 21 Dec 2011 21:45:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Small addition to jPOS XML message format</title>
		<link>http://jpos.org/blog/2009/11/small-addition-to-jpos-xml-message-format/</link>
		<comments>http://jpos.org/blog/2009/11/small-addition-to-jpos-xml-message-format/#comments</comments>
		<pubDate>Wed, 18 Nov 2009 16:10:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[general]]></category>

		<guid isPermaLink="false">http://jpos.org/blog/?p=161</guid>
		<description><![CDATA[When we started to log messages using a very simple XML format a long time ago, and then created the XMLPackager to support that message format, we never thought that this was going to be so heavily used, we frequently &#8230; <a href="http://jpos.org/blog/2009/11/small-addition-to-jpos-xml-message-format/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>When we started to log messages using a very simple XML format a long time ago, and then created the XMLPackager to support that message format, we never thought that this was going to be so heavily used, we frequently find ISO-8583 interchanges based on this format, implemented in different languages by different vendors in different countries.</p>
<p>I&#8217;ve recently been involved in the deployment of an <a href="http://jpos.org/products/isobridge">ISO/Bridge</a> system at a financial institution in one African country connected to another institution at another African country. When I asked for the ISO-8583 specs in order to configure ISO/Bridge, I was surprised to see that the specs where XML based, and basically our spec.</p>
<p>I hope we start seeing this with the <a href="http://jpos.org/blog/2009/08/jpos-cmf/">jPOS CMF</a> soon.</p>
<p>The existing format looks like this:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"> <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;isomsg<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;0800&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;11&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;000001&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;70&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;301&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/isomsg<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Starting in jPOS 1.6.5 r2817, you can optionally use:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"> <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;isomsg<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>0800<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/field<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;11&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>000001<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/field<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;70&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>301<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/field<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/isomsg<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Or any combination, i.e:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"> <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;isomsg<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;0800&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;11&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;000001&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;70&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>301<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/field<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/isomsg<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>This is particularly useful in some implementations that use XML content as part of the ISO-8583 payload, in the past, we had to expand it using XML entities such as &lt;, &gt; that where not nice looking in the logs.</p>
<p>With the new addition, we can:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"> <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;isomsg<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;0800&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;11&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;000001&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;70&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>301<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/field<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;127&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span>&lt; ?xml <span style="color: #000066;">version</span>=<span style="color: #ff0000;">'1.0'</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">'UTF-8'</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;custom<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;tid<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>29110001<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/tid<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;message<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>I love XML tags<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/message<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/custom<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/field<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/isomsg<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>(you have to add a CDATA block around your inner XML)</p>
<p>At response time, we wanted to make it as backward compatible as possible, so we only use this mode if we detect that the field content is XML.</p>
]]></content:encoded>
			<wfw:commentRss>http://jpos.org/blog/2009/11/small-addition-to-jpos-xml-message-format/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jPOS-EE Constants</title>
		<link>http://jpos.org/blog/2006/01/jpos-ee-constants/</link>
		<comments>http://jpos.org/blog/2006/01/jpos-ee-constants/#comments</comments>
		<pubDate>Wed, 18 Jan 2006 22:51:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[general]]></category>

		<guid isPermaLink="false">http://jpos.org/blog/?p=19</guid>
		<description><![CDATA[Simple handling of jPOS-EE Constants <a href="http://jpos.org/blog/2006/01/jpos-ee-constants/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><i>/by apr/</i></p>
<p>If you use the jPOS&#8217; TransactionManager, and you use a Map to pass around your Context among <a href="http://jpos.org/doc/javadoc/org/jpos/transaction/TransactionParticipant.html">participants</a>, you may find yourself creating some kind of <strong>Contants</strong> kind of class in order to define your Context&#8217;s keys.</p>
<p>If you use jPOS-EE-SDK component model, you may find yourself creating a lot of those. distributed among different files, etc. and your code has to extend or implement many different interfaces in order to access them.</p>
<p>I found a very simple solution. as part of jPOS-EE eecore module build, we search for *.k files and create a single org.jpos.ee.Constants file that you can rely to be there.</p>
<p>So you write things like:</p>
<p><b>Context.k</b></p>
<pre>
  public static final String REQUEST = &quot;REQUEST&quot;
  public static final String RESPONSE = &quot;RESPONSE&quot;;
  public static final String TERMINAL = &quot;TERMINAL&quot;;
  ...
  ...</pre>
<p><b>ErrorCode.k</b></p>
<pre>
  public static final String OK = &quot;ok&quot;;
  public static final String INVALID _ISSUER = &quot;invalid.issuer&quot;;
  public static final String INVALID_TERMINAL = &quot;invalid.terminal&quot;;
  ...
  ...
</pre>
<p>that would create an interface <b>org.jpos.ee.Constants</b> like this:</p>
<pre>
package org.jpos.ee;
public interface Constants {
  public static final String REQUEST = &quot;REQUEST&quot;
  public static final String RESPONSE = &quot;RESPONSE&quot;;
  public static final String TERMINAL = &quot;TERMINAL&quot;;
  public static final String OK = &quot;ok&quot;;
  public static final String INVALID _ISSUER = &quot;invalid.issuer&quot;;
  public static final String INVALID_TERMINAL = &quot;invalid.terminal&quot;;
}
</pre>
<p>We do the same with <b>*.p</b> files, we create a single org/jpos/ee/Constants.properties, so you can write something like this:</p>
<pre>
#
# defined in modules/mymodules/src/org/jpos/myapp/MyErrors.p
#
ok = 00 APPROVED
invalid.terminal = 14 INVALID TERMINAL
...
...
</pre>
<p>There&#8217;s also a handy class called <b>org.jpos.ee.K</b> that implements Constants and give you access to the Constants.properties ResourceBundle by using code like this:</p>
<pre>
  String message = K.get (K.OK);  // would give you a &quot;00 APPROVED&quot;
</pre>
<p>PS.- Sorry to disappoint you&#8230; no fancy doclet processing here&#8230; this is just a very simple build  patch  that happens to do what I need. I hope you find it useful.  </p>
]]></content:encoded>
			<wfw:commentRss>http://jpos.org/blog/2006/01/jpos-ee-constants/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

