<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
   <channel>
      <title>Ramkumar Menon&apos;s Blog</title>
      <link>http://blogs.oracle.com/rammenon/</link>
      <description>Principal Consultant</description>
      <language>en-US</language>
      <copyright>Copyright 2009</copyright>
      <lastBuildDate>Fri, 17 Jul 2009 16:06:27 -0800</lastBuildDate>
      <generator>http://www.sixapart.com/movabletype/</generator>
      <docs>http://blogs.law.harvard.edu/tech/rss</docs> 

      
      <item>
         <title>Writing Non-ASCII Content into MQ</title>
         <description><![CDATA[<p>I had Arabic characters coming in from a partner webservice that I needed to write out to an MQ.<br />
The default version was not writing out data into the MQ as expected - the Arabic data was being written out as a bunch of unreadable characters.<br />
Following this, I followed the steps mentioned in the document http://download.oracle.com/docs/cd/E12524_01/relnotes.1013/e12523/adapters.htm#CHDDCAGA.<br />
That did the trick!<br />
</p>]]></description>
         <link>http://blogs.oracle.com/rammenon/2009/07/writing_nonascii_content_into.html</link>
         <guid>http://blogs.oracle.com/rammenon/2009/07/writing_nonascii_content_into.html</guid>
        
        
          <category domain="http://www.sixapart.com/ns/types#tag">BPEL</category>
        
          <category domain="http://www.sixapart.com/ns/types#tag">MQ Adapter</category>
        
          <category domain="http://www.sixapart.com/ns/types#tag">NLS</category>
        
         <pubDate>Fri, 17 Jul 2009 16:06:27 -0800</pubDate>
      </item>
      
      <item>
         <title>Debugging root cause of MQ related Errors</title>
         <description><![CDATA[<p>I ran into a few MQ errors. It helped me to take a look at $MQ_INSTALL_DIR\WebSphereMQ\Qmgrs\&lt;QueueManagerName&gt;\errors directory to see whats going on!</p>]]></description>
         <link>http://blogs.oracle.com/rammenon/2009/06/debugging_root_cause_of_mq_rel.html</link>
         <guid>http://blogs.oracle.com/rammenon/2009/06/debugging_root_cause_of_mq_rel.html</guid>
        
        
         <pubDate>Mon, 29 Jun 2009 21:25:25 -0800</pubDate>
      </item>
      
      <item>
         <title>DBAdapter - java.sql.SQLException: ORA-00932: inconsistent datatypes: expected - got CLOB</title>
         <description><![CDATA[<p>Observed on BPEL PM 10.1.3.3.</p>

<p>We had a set of master-detail tables that had one of the columns as a CLOB, and a process that is polling for new or changed records on these tables.<br />
When the process is deployed, the endpoint activation fails complaining "Expected - CLOB".</p>

<p>The reason is that when the toplink query is generated, it generates a DISTINCT clause in the select statement, and DISTINCT clause cannot be applied if one of the return columns are CLOBs.<br />
The solution - Open up the toplink mappings XML file and update the batch-attribute reading value to "false" from "true".</p>

<p>We figured this out from the <a href="http://download.oracle.com/docs/cd/B14099_19/integrate.1012/b25307/app_trblshoot.htm">Troubleshooting and Workarounds section</a> of the Adapters documentation.<br />
I am inlining the relvant snippet from the document for convenience.</p>

<p>A SELECT returning CLOB values must not use the DISTINCT clause. The simplest way to avoid DISTINCT is to disable batch attribute reading from A to B. Batch reading is a performance enhancement that attempts to simultaneously read all Bs of all previously queried As. This query uses a DISTINCT clause. Use joined reading instead, or neither joined reading nor batch attribute reading.</p>

<p>Because both DISTINCT and CLOBs are common, you may see this problem in other scenarios. For example, an expression like the following uses a DISTINCT clause:</p>

<p>SELECT DISTINCT dept.* from Department dept, Employee emp WHERE ((dept.ID =<br />
emp.DEPTNO) and (emp.name = 'Bob Smith'));</p>]]></description>
         <link>http://blogs.oracle.com/rammenon/2009/03/dbadapter_javasqlsqlexception.html</link>
         <guid>http://blogs.oracle.com/rammenon/2009/03/dbadapter_javasqlsqlexception.html</guid>
        
        
          <category domain="http://www.sixapart.com/ns/types#tag">BPEL</category>
        
          <category domain="http://www.sixapart.com/ns/types#tag">DBAdapter</category>
        
         <pubDate>Thu, 05 Mar 2009 23:49:10 -0800</pubDate>
      </item>
      
      <item>
         <title><![CDATA[Tackling &quot;Failed to evaluate correlation query&quot;]]></title>
         <description><![CDATA[<p>Problem observed on BPEL PM 10.1.3.3.</p>

<p>I developed a simple BPEL process that uses BPEL correlation to receive callbacks into the process.<br />
For this purpose, I altered the process WSDL to add one more operation.<br />
The initiating operation was named "processOrder". I decided to name the callback operation as "processOrderCallback".<br />
I promptly defined two properties on the correlation set and provided aliases for both for the invocation and callback messages.<br />
When I invoke the process, it throws up a CubeException and goes to recovery mode.<br />
Why? Possibly because the callback operation name is a "superstring" of the invocation operation name.<br />
When I looked at the logs, I could see that the engine was trying to evaluate the correlation query for the callback on the initiating message.<br />
What I did next - just renamed the operation to "receiveOrderCallback" and re-ran the instance.<br />
Bingo! - it worked.<br />
</p>]]></description>
         <link>http://blogs.oracle.com/rammenon/2009/03/tackling_failed_to_evaluate_co.html</link>
         <guid>http://blogs.oracle.com/rammenon/2009/03/tackling_failed_to_evaluate_co.html</guid>
        
        
          <category domain="http://www.sixapart.com/ns/types#tag">BPEL</category>
        
          <category domain="http://www.sixapart.com/ns/types#tag">Correlation</category>
        
         <pubDate>Wed, 04 Mar 2009 01:59:46 -0800</pubDate>
      </item>
      
      <item>
         <title>Deploying static content and java web services to Weblogic 9.2</title>
         <description><![CDATA[<p>I had a simple BPEL on Weblogic install - and was looking for a place to host some static XML content on the server. On OC4J, it was simple - just dump the content in the appropriate directories under htdocs, and you are done. <br />
In a simple WLS install like the one I have, it doesn't work that way. <br />
So I created a simple Web Project, added all my XML contents into it, and deployed the ear file into WLS, just like any J2EE application. Here you go - you can now access all the hosted content at the contextURI that you specified at deployment time!</p>

<p>Well, I use JDeveloper 10.1.3.3 - and needed to create and deploy a simple Java Web Service into WLS. I tried using the standard deploy-to-weblogic app server connection - but alas! - I ran into some deployment issues while deploying JWS from JDev 10.1.3.3 to WLS 9.2. The same error repeats if I pick up the ear file and deploy it directly from the WLS admin console.</p>

<p>But hey, there was a simple way to get it done.<br />
Just use the WLS service generation build scripts - it will do the job just as well.</p>

<p>Here is a snippet of the build script that I used to deploy my WS onto WLS.</p>

<p>&lt;project name="BuildHelloWorldService" default="ear"><br />
  &lt;target name="ear"><br />
    &lt;servicegen destEar="ears/HelloWorldService.ear" warName="HelloWorldService.war" contextURI="hello"><br />
      &lt;classpath><br />
         &lt;pathelement path="${java.class.path}" />   <br />
         &lt;pathelement location="D:\oraBPEL\bpel\lib\orabpel.jar"/><br />
         &lt;pathelement location="D:\oraBPEL\bpel\lib\xmlparserv2.jar"/>     <br />
      &lt;/classpath><br />
      &lt;service targetNamespace="http://xmlns.hello.com/"<br />
               serviceURI="/HelloWorldService"<br />
               generateTypes="True"<br />
               expandMethods="True"<br />
               javaClassComponents="com.hello.HelloWorld,com.hello.HelloWorldUtil,com.hello.util.HelloUtil"<br />
               serviceName="HelloWorldService"<br />
               style="document"><br />
      &lt;/service> <br />
    &lt;/servicegen><br />
  &lt;/target></p>

<p>Note that servicegen is an 8.1 release ant task. WLS 9.2 has updated ant tasks that you can leverage to build services from your java classes. I used it only for my local testing.<br />
You can find detailed information on useful ant tasks for service generation, client stub generation and others on the WLS 9.2 documentation page.</p>

<p>http://e-docs.bea.com/wls/docs92/webserv/anttasks.html</p>]]></description>
         <link>http://blogs.oracle.com/rammenon/2009/03/deploying_static_content_and_j.html</link>
         <guid>http://blogs.oracle.com/rammenon/2009/03/deploying_static_content_and_j.html</guid>
        
          <category domain="http://www.sixapart.com/ns/types#category">Deployment</category>
        
        
          <category domain="http://www.sixapart.com/ns/types#tag">WLS 9.2</category>
        
          <category domain="http://www.sixapart.com/ns/types#tag">java web service deployment</category>
        
         <pubDate>Mon, 02 Mar 2009 22:55:11 -0800</pubDate>
      </item>
      
      <item>
         <title><![CDATA[XML Parsing failed because of &quot;&quot; Potential fix N/A]]></title>
         <description><![CDATA[<p>If you run into this error while compiling your BPEL project, open up your build.properties file and set verbose=true. Then run the compilation from the ant build, instead of the jdev compile/deploy.<br />
You will get a stack trace from the ant build log that will give you some hints on the reasons for the compilation error.</p>]]></description>
         <link>http://blogs.oracle.com/rammenon/2009/02/xml_parsing_failed_because_of.html</link>
         <guid>http://blogs.oracle.com/rammenon/2009/02/xml_parsing_failed_because_of.html</guid>
        
        
          <category domain="http://www.sixapart.com/ns/types#tag">BPEL</category>
        
         <pubDate>Fri, 20 Feb 2009 18:51:45 -0800</pubDate>
      </item>
      
      <item>
         <title>Base64 Explained</title>
         <description><![CDATA[<p>Base64 is a mechanism to enable representing and transferring binary data over mediums that allow only printable characters.It is most popular form of the “Base Encoding”, the others known in use being Base16 and Base32.</p>  <p>The need for Base64 arose from the need to attach binary content to emails like images, videos or arbitrary binary content .&#160; Since SMTP [RFC 5321] only allowed 7-bit US-ASCII characters within the messages,&#160; there was a need to represent these binary octet streams using the seven bit ASCII characters. </p>  <p>Here is what RFC 5321 [Simple Mail Transfer protocol] states.</p>  <p><em>“Commands and replies are composed of characters from the ASCII character set [</em><a href="http://tools.ietf.org/#ref-6"><em>6</em></a><em>]. When the transport service provides an 8-bit byte (octet) transmission channel, each 7-bit character is transmitted, right justified, in an octet with the high-order bit cleared to zero. <u>More specifically, the unextended SMTP service provides 7-bit </u></em><em><u>transport only</u>. An originating SMTP client that has not successfully negotiated an appropriate extension with a particular server (see the next paragraph) MUST NOT transmit messages with information in the high-order bit of octets. If such messages are transmitted in violation of this rule, receiving SMTP servers MAY clear the high- order bit or reject the message as invalid.”</em></p>  <p>This led to the evolution and popularity of the Internet Standards like MIME [stands for Multipurpose Internet Mail Extensions]. MIME provided mechanisms to allow things like writing text using characters from a repertoire that require a different character encoding, and more importantly, allow one or more binary attachments to the e-mail.</p>  <p>Since the underlying medium supports only plain ASCII text, MIME defined a set of binary-to-text encodings that enable capturing these binary octet streams into printable ASCII characters that can be used with mediums like SMTP. Base64 is one such binary-to-text encoding. For this purpose, MIME defines, among others, a header named Content transfer encoding that indicates whether a binary-to-text encoding has been applied on the message content, and if so, specifies the actual encoding that has been employed. Base64 is one of them.</p>  <p>On the other hand, 7 bit ASCII characters contain a set of 94 printable characters and 33 non-printable ones. 64 is the highest power of 2 that can be represented using only printable characters that are mostly common among different character encodings in existence, most importantly, ASCII. What this means is that a hypothetical Base128 encoding will not be limited to the permitted set of printable characters, and hence will be unsuitable for the use-case at hand. </p>  <p>The following is the character subset of US-ASCII that is used for Base64. </p>  <ol>   <li>[a-z] – 26 characters&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </li>    <li>[A-Z] – 26 characters&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </li>    <li>[0-9] – 10 characters&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </li>    <li>[+]&#160; - 1 character [filler character] </li>    <li>[<strong>/</strong>]&#160;&#160; - 1 character [filler character] </li>    <li>[=]&#160; - Used for Padding purposes, as explained later. </li> </ol>  <p>Since the numerals and alphabets make up for only 62 characters in all, Base64 chose “+” and “/” to fill the gap. The following is an excerpt from RFC 4648 illustrating the Alphabet for Base64.</p>  <p><a href="http://blogs.oracle.com/rammenon/WindowsLiveWriter/WhatisBase64_14272/base64table.jpg"><img title="base64table" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="372" alt="base64table" src="http://blogs.oracle.com/rammenon/WindowsLiveWriter/WhatisBase64_14272/base64table_thumb.jpg" width="622" border="0" /></a> </p>  <h3>The Encoding Process</h3>  <p>The process to encode the input stream is fairly straightforward.</p>  <p>a) The octet stream is read from left to right.</p>  <p>b) Three 8-bit groups within the input stream is concatenated to form a 24-bit group.</p>  <p>c) This 24-bit group is further treated as four 6-bit groups that is right justified using zeroes. The grouping into 6 bits is for the simple reason that 6 bits will cover the range of printable characters [0-2<sup>6</sup>-1]</p>  <p>d) Each of these 4 groups is then encoded using the above-mentioned chart in table 1.</p>  <p>The case when the input bit stream contains less than 24 characters will be explained after the following example.</p>  <p>Let’s say we wish to encode the string “ORACLE” using the Base-64 alphabet. </p>  <p>&#160;</p>  <table cellspacing="0" cellpadding="2" width="560" border="2"><tbody>     <tr>       <td valign="top" width="109"><strong><font size="1">Input String</font></strong></td>        <td align="center" width="52"><font size="1">O</font></td>        <td align="center" width="58"><font size="1">R</font></td>        <td align="center" width="52"><font size="1">A</font></td>        <td align="center" width="49"><font size="1">C</font></td>        <td align="center" width="67"><font size="1">L</font></td>        <td align="center" width="65"><font size="1">E</font></td>        <td align="center" width="38"><font size="1">.</font></td>        <td align="center" width="66"><font size="1"></font>.</td>     </tr>      <tr>       <td valign="top" width="109"><strong><font size="1">Binary Representation</font></strong></td>        <td align="center" width="52"><font size="1">01001111<sub>2</sub></font></td>        <td align="center" width="58"><font size="1">01010010<sub>2</sub> </font></td>        <td align="center" width="52"><font size="1">01000001<sub>2</sub> </font></td>        <td align="center" width="49"><font size="1">01000011<sub>2</sub> </font></td>        <td align="center" width="67"><font size="1">01001100<sub>2</sub></font></td>        <td align="center" width="65"><font size="1">01000101<sub>2</sub> </font></td>        <td align="center" width="38"><font size="1">.</font></td>        <td align="center" width="66"><font size="1"></font>.</td>     </tr>      <tr>       <td valign="top" width="109"><font size="1"><strong>After regrouping into 6-bit groups.              <br /></strong><em>[Binary and decimal equivalents are shown.]</em></font></td>        <td align="center" width="52"><font size="1">010011<sub>2</sub>             <br />[19<sub>10</sub>]</font></td>        <td align="center" width="58"><font size="1">110101<sub>2</sub>             <br />[53<sub>10</sub>]</font></td>        <td align="center" width="52"><font size="1">001001 </font><font size="1"><sub>2              <br /></sub>[9<sub>10</sub>]</font></td>        <td align="center" width="49"><font size="1">000001<sub>2</sub>             <br />[1<sub>10</sub>]</font></td>        <td align="center" width="67"><font size="1">010000<sub>2</sub>             <br />[16<sub>10</sub>]</font></td>        <td align="center" width="65"><font size="1">110100<sub>2</sub>             <br />[52<sub>10</sub>]</font></td>        <td align="center" width="38"><font size="1">110001<sub>2</sub>             <br />[49<sub>10</sub>]</font></td>        <td align="center" width="66"><font size="1">000101\<sub>2</sub>             <br />[5<sub>10</sub>]</font></td>     </tr>      <tr>       <td valign="top" width="109"><strong><font size="1">After mapping the above eight 8-bit bytes using Table 1</font></strong></td>        <td align="center" width="52"><font size="1">T</font></td>        <td align="center" width="58"><font size="1">1</font></td>        <td align="center" width="52"><font size="1">J</font></td>        <td align="center" width="49"><font size="1">B</font></td>        <td align="center" width="67"><font size="1">Q</font></td>        <td align="center" width="65"><font size="1">0</font></td>        <td align="center" width="38"><font size="1">x</font></td>        <td align="center" width="66"><font size="1">F</font></td>     </tr>   </tbody></table>  <blockquote>   <p>Base64 encoded string : <strong>T1JBQ0xF</strong></p> </blockquote>  <p>In the above scenario, the input character string contains 48 bits, an exact multiple of 24 that enables exact grouping into 6 bit groups. But in the event that there are less than 24 characters, or if the number of bits in the input stream is not a multiple of 24, padding is used to make up for the remaining bits.</p>  <p>The methodology for padding is as follows.</p>  <p>Add as many “zero” bits to the right of the 6-bit grouped bit stream so that the total bit length is a multiple of 24. If the modified input data contains any octets that contain only padded zeroes, replace each of those octets with the padding character “=”. </p>  <p>&#160;</p>  <p>This is illustrated in the next example.</p>  <p>In the table below, the input string contains 40 bits. Hence 8 more bits need to be padded on the right to make up for 48, an exact multiple of 24.</p>  <table cellspacing="0" cellpadding="2" width="584" border="2"><tbody>     <tr>       <td valign="top" width="137"><strong><font size="1">Input String</font></strong></td>        <td align="center" width="45"><font size="1">M</font></td>        <td align="center" width="64"><font size="1">E</font></td>        <td align="center" width="80"><font size="1">N</font></td>        <td align="center" width="49"><font size="1">O</font></td>        <td align="center" width="58"><font size="1">N</font></td>        <td align="center" width="51"><font size="1">&#160; .</font></td>        <td align="center" width="49">.<font size="1"></font></td>        <td align="center" width="47"><font size="1"></font>.</td>     </tr>      <tr>       <td valign="top" width="138"><strong><font size="1">Binary Representation</font></strong></td>        <td align="center" width="45">         <p><font size="1">01001101<sub>2</sub></font></p>       </td>        <td align="center" width="64">         <p><font size="1">01000101<sub>2</sub></font></p>       </td>        <td align="center" width="80">         <p><font size="1">01001110<sub>2</sub></font></p>       </td>        <td align="center" width="49">         <p><font size="1">01001111<sub>2</sub></font></p>       </td>        <td align="center" width="58">         <p><font size="1">01001110<sub>2</sub></font></p>       </td>        <td align="center" width="51"><font size="1">.</font></td>        <td align="center" width="49"><font size="1"></font>.</td>        <td align="center" width="47"><font size="1"></font>.</td>     </tr>      <tr>       <td valign="top" width="142"><font size="1"><strong>After regrouping into 6-bit groups.              <br /></strong><em>[Binary and decimal equivalents are shown.]. The bold zeroes on the right indicates the padded zeroes - 2+6.</em></font></td>        <td align="center" width="45"><font size="1">010011<sub>2</sub>             <br />[19<sub>10</sub>]</font></td>        <td align="center" width="64"><font size="1">010100<sub>2</sub>             <br />[20<sub>10</sub>]</font></td>        <td align="center" width="80"><font size="1">010101 </font><font size="1"><sub>2              <br /></sub>[21<sub>10</sub>]</font></td>        <td align="center" width="49">         <p><font size="1">001110<sub>2</sub>               <br />[14<sub>10</sub>]</font></p>       </td>        <td align="center" width="58">         <p><font size="1">010011<sub>2</sub>               <br />[16<sub>10</sub>]</font></p>       </td>        <td align="center" width="51">         <p><font size="1">110100<sub>2</sub> [52<sub>10</sub>]</font></p>       </td>        <td align="center" width="49">         <p><font size="1">1110<strong>00</strong></font></p>          <p><font size="1"><strong>[56</strong><sub>10</sub><strong>]</strong></font></p>       </td>        <td align="center" width="47"><strong><font size="1">000000              <br />=</font></strong></td>     </tr>      <tr>       <td valign="top" width="137"><strong><font size="1">After mapping the above eight 8-bit bytes using Table 1</font></strong></td>        <td align="center" width="45"><font size="1">T</font></td>        <td align="center" width="64"><font size="1">U</font></td>        <td align="center" width="80"><font size="1">V</font></td>        <td align="center" width="49"><font size="1">O</font></td>        <td align="center" width="58"><font size="1">Q</font></td>        <td align="center" width="51"><font size="1">0</font></td>        <td align="center" width="49"><font size="1">4</font></td>        <td align="center" width="47"><font size="1">=</font></td>     </tr>   </tbody></table>  <p>&#160;</p>  <p>Base64 Encoded String : <strong>TUVOQ04=</strong></p>  <p>As evident from the above two examples, Base64 encoded data will always be much larger than the size of the original input stream. It has been estimated that it approximately increases the size by around 137% –i.e. a third more than the original size.</p>  <p><strong>Other Applications for Base64</strong></p>  <p>Base64 has been used for other purposes as well, in addition to being used as a mechanism for content encoding within MIME.</p>  <p>a) Content obfuscation</p>  <p>For instance, it is used for simple obfuscation of data when exchanged between applications. Of course, any base64 encoded string can be reverse engineered to obtain the original set of bytes.Hence it cannot replace any good encryption mechanism.&#160; </p>  <p>b) Binary content handling in Web Services</p>  <p>Base64 can also be used to send to / receive messages with binary content from Web Services. Note that this is not an efficient mechanism for large payloads due to the the size bloat-up caused by the Base-64 transformation.For such use-cases, it is advisable to send the payload as an attachment using&#160; SOAP with Attachments or Message Transmission Optimization Mechanism [MTOM].</p>  <p><strong>Base64 and XML </strong></p>  <p>XML documents can be carriers for binary content as well. Binary data can be base-64 encoded and be specified inline within any XML 1.0 document. </p>  <p>Data within XML entities belong to the Unicode repertoire. The following is the production for a character in an XML 1.0 document.</p>  <p><code>Char</code>&#160;&#160; ::=&#160;&#160; <code>#x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF] </code><i>/* any Unicode character, excluding the surrogate blocks, FFFE, and FFFF. */</i></p>  <p></a></p>  <p>The XML Document, or any entity within the XML document can declare its character encoding as a part of a character encoding declaration. For the entire document, this is usually specified as a part of the XML document declaration.</p>  <p>&lt;?xml version=”1.0” encoding=”UTF-8”?&gt;</p>  <p>The character encodings supported by an XML processor may vary, but compliance to XML 1.0 requires acceptance of XML documents encoded using Unicode transformation formats[UTF] UTF-8 and UTF-16.</p>  <p>XML 1.0 specification states </p>  <p><em>“All XML processors MUST accept the UTF-8 and UTF-16 encodings of Unicode.“</em></p>  <p>UTF-8 and UTF-16 are character encodings, just like US-ASCII or ISO-8859-1. They associate a numeric code with each character in a character repertoire.&#160; Whereas ASCII works off a limited 128 character repertoire, Unicode is much more comprehensive, covering for all major and most minor written languages of the world.&#160; The two transformation formats provide character encodings for all characters in Unicode. When a processing application receives a UTF encoded XML document containing base64 encoded data, the decoding must be performed on the character data obtained after performing the character encoding processing. This is because these character encodings actually determine how the bytes are ordered [Endianness], and also determine how many bytes represent a single character. Detailed discussion of Unicode and its associated transformation formats is outside the scope of this document. </p>  <p><strong>Base64 and XML Schema</strong></p>  <p>The XML Schema datatype library defines a core datatype whose value space contains base64 encoded binary data. It is named “base64Binary”. This helps facilitate description of binary element content. </p>  <p><strong><u>Note:</u></strong> The bas64Binary is the datatype used for defining opaque content within your messages in BPEL PM. You would have seen the usage of this datatype while modeling an adapter interaction.</p>  <p><strong>Listing 1: WSDL illustrating opaque content definition for binary data</strong></p>  <p><a href="http://blogs.oracle.com/rammenon/WindowsLiveWriter/WhatisBase64_14272/opaque.jpg"><img title="opaque" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="619" alt="opaque" src="http://blogs.oracle.com/rammenon/WindowsLiveWriter/WhatisBase64_14272/opaque_thumb.jpg" width="632" border="0" /></a> </p>  <p><strong>Listing 2 : Audit Trail of writing opaque data out</strong></p>  <p><a href="http://blogs.oracle.com/rammenon/WindowsLiveWriter/WhatisBase64_14272/opaque_audit.jpg"><img title="opaque_audit" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="93" alt="opaque_audit" src="http://blogs.oracle.com/rammenon/WindowsLiveWriter/WhatisBase64_14272/opaque_audit_thumb.jpg" width="631" border="0" /></a> </p>  <p>For explicitly base64 encoding a document, XML or otherwise, the product provides a Base64Encoder utility. There aren’t any XPath extension functions that enable base64 encoding of documents.</p>  <p>The utility can be used from within a Java embedding activity to achieve the desired results.</p>  <p>&#160;</p>  <p><font face="Courier New" color="#0000ff" size="2"><em>&lt;bpelx:exec name=&quot;encodeMessage&quot; language=&quot;java&quot; version=&quot;1.3&quot; id=&quot;BxExe0&quot;&gt;</em></font></p>  <p><font face="Courier New" color="#0000ff" size="2"><em>&lt;![CDATA[</em></font></p>  <p><font face="Courier New" color="#0000ff" size="2"><em>&#160;&#160; try {&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160; com.collaxa.common.util.Base64Encoder encoder = new com.collaxa.common.util.Base64Encoder();&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160; String encodedData = &quot;&quot; + encoder.encode(&quot;&quot; + getVariableData(&quot;payloadVar&quot;));&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160; setVariableData(&quot;payloadVar&quot;,encodedData);&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160; </em></font></p>  <p><font face="Courier New" color="#0000ff" size="2"><em>&#160;&#160;&#160; }catch(Throwable ex) {&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160; //Handle errors here         <br />&#160;&#160;&#160; }</em></font></p>  <p><font face="Courier New" color="#0000ff" size="2"><em>]]&gt;</em></font></p>  <p><font face="Courier New" color="#0000ff" size="2"><em>&lt;/bpelx:exec&gt;</em></font></p>  <p>&#160;</p>  <p>Interestingly, XML Schema does not provide a way to indicate the media type of the binary data. Jonathan Marsh from the WSDL WG has a <a href="http://www.w3.org/2005/05/25-schema/WSDL.html">note</a> on this. </p>  <p>Quoting&#160; JM - </p>  <p><em>“One aspect of XML-based messages are difficult to fully capture in XML Schema is the meaning of base64-encoded binary data. XML Schema does provide facilities to describe that element content is base64-encoded binary (through the xs:base64Binary simple type), but it does not provide simple and user-accessible facilities to indicate the format of that binary data. The WSDL WG in conjunction with the XMLP WG, developed a </em><a href="http://www.w3.org/TR/xml-media-types/"><em>W3C WG Note</em></a><em> describing schema extensions that allow the media type (or a set of related media types) to be described. Using this facility, a WSDL consumer can determine not only that a specific message should contain base64-encoded binary data, but that that binary data represents a particular media type such as image/jpeg.”</em></p>]]></description>
         <link>http://blogs.oracle.com/rammenon/2008/12/base64_explained.html</link>
         <guid>http://blogs.oracle.com/rammenon/2008/12/base64_explained.html</guid>
        
        
         <pubDate>Sat, 13 Dec 2008 05:41:13 -0800</pubDate>
      </item>
      
      <item>
         <title>A tussle with BAM and ASPNET</title>
         <description><![CDATA[<p><u><strong>The first symptom ....</strong></u></p>

<p>Oracle BAM Active data cache fails to start.</p>

<p>I went ahead and checked the logs in $ORACLE_BAM_HOME\Logs\ActiveDataCache.log.</p>

<p>I see a error trace that looks like</p>

<p><em>2008-12-06 03:02:01,391 [732] ERROR - ActiveDataCache       DPAPI was unable to decrypt data. CryptUnprotectData failed. Error -2146893813: Key not valid for use in specified state.</p>

<p>2008-12-06 03:02:01,401 [732] WARN  - ActiveDataCache       Exception occurred in method Startup</p>

<p><u>Stack trace:</u><br />
   at Oracle.BAM.Common.Security.DataProtector.DPAPI.Decrypt(Byte[] cipherTextBytes, Byte[] entropyBytes, String& description)<br />
   at Oracle.BAM.Common.Security.DataProtector.DPAPI.Decrypt(String cipherText, String entropy, String& description)<br />
   at Oracle.BAM.Common.Security.DataProtector.DPAPI.Decrypt(String cipherText)<br />
   at Oracle.BAM.Common.Security.DataProtector.DataProtector.Decrypt(String strData)<br />
   at Oracle.BAM.ActiveDataCache.Kernel.StorageEngine.Oracle.ConnectionStringDecrypter.Decrypt(String strEncrypted)<br />
   at Oracle.BAM.ActiveDataCache.Kernel.StorageEngine.Oracle.OracleDataFactory.GetInstance()<br />
   at Oracle.BAM.ActiveDataCache.Kernel.StorageEngine.Oracle.OracleStorageEngine.GetDataFactory()<br />
   at Oracle.BAM.ActiveDataCache.Kernel.StorageEngine.Oracle.OracleStorageEngine.GetServerVersion()<br />
   at Oracle.BAM.ActiveDataCache.Kernel.StorageEngine.Oracle.OracleStorageEngine.Startup(IDictionary oParameters)<br />
   at Oracle.BAM.ActiveDataCache.Kernel.Server.DataStoreServer.Startup()</em></p>

<p><u><strong>Resolution</strong></u></p>

<p>Fortunately, Metalink had a nice note on this one.<br />
See Document <a href="https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=467837.1">467837.1</a> on metalink.</p>

<p><strong><u>The next showstopper</u></strong></p>

<p>After this got fixed, I attempted to load up the Oracle BAM home page - but it would not load up.<br />
It stated the following error message.</p>

<p>"Server Application Unavailable</p>

<p>The web application you are attempting to access on this web server is currently unavailable.</p>

<p>Please hit the "Refresh" button in your web browser to retry your request. "</p>

<p>I went ahead and took a look at the Event Viewer in my Control Panel --> Administrative Tools.</p>

<p>It had a bunch of errors that stated </p>

<p><i>aspnet_wp.exe could not be started. The error code for the failure is 80004005. This error can be caused when the worker process account has insufficient rights to read the .NET Framework files. Please ensure that the .NET Framework is correctly installed and that the ACLs on the installation directory allow access to the configured account.<br />
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.</i></p>

<p><u><strong>Resolution</strong></u></p>

<p><br />
Fortunately, I was able to find a solution at <a href="http://support.microsoft.com/kb/315158">http://support.microsoft.com/kb/315158</a>.</p>]]></description>
         <link>http://blogs.oracle.com/rammenon/2008/12/a_tussle_with_bam_and_aspnet.html</link>
         <guid>http://blogs.oracle.com/rammenon/2008/12/a_tussle_with_bam_and_aspnet.html</guid>
        
          <category domain="http://www.sixapart.com/ns/types#category">BAM</category>
        
        
          <category domain="http://www.sixapart.com/ns/types#tag">BAM</category>
        
         <pubDate>Sat, 06 Dec 2008 03:18:04 -0800</pubDate>
      </item>
      
      <item>
         <title>Setting encoding of an XML document</title>
         <description><![CDATA[<p>When you need to write an XML document into a queue/file, and if you wish to explicitly set the encoding on the xml document declaration, add the following onto the <schema> element of the XSD for the document that you are writing out.</p>

<p>&lt; xsd:schema ....... xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd" nxsd:encoding="UTF-8" ... &gt;<br />
 ...<br />
&lt; /xsd:schema &gt;</p>

<p><br />
The output document will then have the xml document declaration as</p>

<blockquote>&lt; ?xml version="1.0" encoding="UTF-8"? &gt;</blockquote> ...]]></description>
         <link>http://blogs.oracle.com/rammenon/2008/11/setting_encoding_of_a_document_1.html</link>
         <guid>http://blogs.oracle.com/rammenon/2008/11/setting_encoding_of_a_document_1.html</guid>
        
        
          <category domain="http://www.sixapart.com/ns/types#tag">Encoding</category>
        
          <category domain="http://www.sixapart.com/ns/types#tag">NXSD</category>
        
          <category domain="http://www.sixapart.com/ns/types#tag">XML</category>
        
         <pubDate>Wed, 26 Nov 2008 15:24:59 -0800</pubDate>
      </item>
      
      <item>
         <title><![CDATA[HTTP transport error: Message send failed: For input string &ldquo;&rdquo;]]></title>
         <description><![CDATA[<p></p>  <p></p>  <p></p>  <p></p>  <p>Another tough error message to decrypt. </p>  <p>I had a simple BPEL Process that invoked a remote SOAP/HTTP web service. I had BPEL PM&#160; 10.1.3.3 running on BEA WLS 9.2.</p>  <p>When I run the BPEL process from the console, the outbound invocation throws back a remote fault.</p>  <p>&#160;</p>  <p><em>[2008/11/02 13:06:10] &quot;{</em><a href="http://schemas.oracle.com/bpel/extension}remoteFault&quot;"><em>http://schemas.oracle.com/bpel/extension}remoteFault&quot;</em></a><em> has been thrown.less      <br />&lt;remoteFault xmlns=&quot;</em><a href="http://schemas.oracle.com/bpel/extension&quot;"><em>http://schemas.oracle.com/bpel/extension&quot;</em></a><em>&gt;&#160; <br />&#160;&#160; &lt;part name=&quot;summary&quot;&gt;       <br />&#160;&#160;&#160;&#160;&#160; &lt;summary&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160; exception on JaxRpc invoke: HTTP transport error: javax.xml.soap.SOAPException: java.security.PrivilegedActionException: javax.xml.soap.SOAPException: Message send failed: For input string: &quot;&quot;</em></p>  <p><em>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/summary&gt;      <br />&#160;&#160;&#160;&#160; &lt;/part&gt;       <br />&lt;/remoteFault&gt; </em></p>  <p></p>  <p></p>  <p></p>  <p></p>  <p></p>  <p></p>  <p></p>  <p></p>  <p></p>  <p></p>  <p></p>  <p>The reason:</p>  <p>The JVM arguments –Dhttp.poxyHost and –Dhttp.proxyPort had empty values in the config.xml for the domain. i.e. –Dhttp.proxyHost= –Dhttp.proxyPort=</p>  <p>[In the admin console, you can view this in the “Startup” section in the “Server” section.</p>  <p>I removed these arguments from the startup section, and things just worked like a charm! </p>]]></description>
         <link>http://blogs.oracle.com/rammenon/2008/11/http_transport_error_message_s.html</link>
         <guid>http://blogs.oracle.com/rammenon/2008/11/http_transport_error_message_s.html</guid>
        
        
         <pubDate>Sun, 02 Nov 2008 11:25:37 -0800</pubDate>
      </item>
      
      <item>
         <title>BPEL Correlation within FlowN</title>
         <description><![CDATA[<p>I was struggling a bit today while testing a simple process that does a flowN and does simple BPEL correlation..</p>  <p>Failed to evaluate correlation query.   <br />Failed to evaluate the correlationAlias query &quot;/client:FlowNCorrelationDemoEvent/client:id&quot; on the element &quot;oracle.xml.parser.v2.XMLElement@283a35b&quot;    <br />Please check your BPEL/WSDL source to make sure that property alias is defined correctly. </p>  <p>&#160;&#160;&#160; at com.collaxa.cube.engine.delivery.CorrelationProperty.setMessagePart(CorrelationProperty.java:85)   <br />&#160;&#160;&#160; at com.collaxa.cube.engine.delivery.DeliveryHelper.createCorrelationSet(DeliveryHelper.java:140)    <br />&#160;&#160;&#160; at com.collaxa.cube.engine.delivery.SOAPProtocolHandler.calculateCorrelations(SOAPProtocolHandler.java:751)    <br />&#160;&#160;&#160; at com.collaxa.cube.engine.delivery.SOAPProtocolHandler.receiveCallback(SOAPProtocolHandler.java:167)    <br />&#160;&#160;&#160; at com.collaxa.cube.engine.delivery.DeliveryService.receiveCallback(DeliveryService.java:462)    <br />&#160;&#160;&#160; at com.collaxa.cube.engine.ejb.impl.CubeDeliveryBean.receiveCallback(CubeDeliveryBean.java:108)    <br />&#160;&#160;&#160; at com.collaxa.cube.engine.ejb.impl.CubeDeliveryBean_yt19iq_ELOImpl.receiveCallback(CubeDeliveryBean_yt19iq_ELOImpl.java:307)    <br />&#160;&#160;&#160; at com.collaxa.cube.engine.delivery.DeliveryHandler.continuePostAnyType(DeliveryHandler.java:429)    <br />&#160;&#160;&#160; at com.collaxa.cube.engine.delivery.DeliveryHandler.continuePost(DeliveryHandler.java:380)    <br />&#160;&#160;&#160; at com.collaxa.cube.engine.delivery.DeliveryHandler.post(DeliveryHandler.java:93)    <br />&#160;&#160;&#160; at com.collaxa.cube.ejb.impl.DeliveryBean.post(DeliveryBean.java:203)    <br />&#160;&#160;&#160; at com.collaxa.cube.ejb.impl.DeliveryBean.post(DeliveryBean.java:158)    <br />&#160;&#160;&#160; at com.collaxa.cube.ejb.impl.DeliveryBean_uhics8_EOImpl.post(DeliveryBean_uhics8_EOImpl.java:279)</p>  <p></p>  <p>It seems that the issue was occuring when I was initiating the process that contains a midprocess receive that is based off an operation in the same portType that contains the initiating operation for the service, through the BPEL console.</p>  <p>&lt;portType name=&quot;FlowNCorrelationDemo&quot;&gt;   <br />&#160;&#160;&#160; &lt;operation name=&quot;initiate&quot;&gt;    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;input message=&quot;client:FlowNCorrelationDemoRequestMessage&quot;/&gt;    <br />&#160;&#160;&#160; &lt;/operation&gt;    <br />&#160;&#160;&#160; &lt;operation name=&quot;callback&quot;&gt;    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;input message=&quot;client:FlowNCorrelationDemoEventMessage&quot;/&gt;    <br />&#160;&#160;&#160; &lt;/operation&gt;    <br />&lt;/portType&gt;</p>  <p>Things worked just fine when I created another BPEL process and invoked this main BPEL process from the former.</p>  <p>You can find the set of BPEL processes, together with a readme file at <a title="http://blogs.oracle.com/rammenon/FlowNCorrelationDemo.zip" href="http://blogs.oracle.com/rammenon/FlowNCorrelationDemo.zip">http://blogs.oracle.com/rammenon/FlowNCorrelationDemo.zip</a>.</p>  <p>You can find all the information about the services that I have used in the sample at the above URL.</p>  <p>1. Initiate the client service. The client service invokes the main service with the given payload.</p>  <p><a href="http://blogs.oracle.com/rammenon/WindowsLiveWriter/BPELCorrelationwithinFlowN_5E4/initiate_client.jpg"><img title="initiate_client" style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="352" alt="initiate_client" src="http://blogs.oracle.com/rammenon/WindowsLiveWriter/BPELCorrelationwithinFlowN_5E4/initiate_client_thumb.jpg" width="501" border="0" /></a> </p>  <p>2. Review the flow of main service. It should be waiting for the callbacks from within the flowN.</p>  <p><a href="http://blogs.oracle.com/rammenon/WindowsLiveWriter/BPELCorrelationwithinFlowN_5E4/main_service_waiting_for_callback.jpg"><img title="main_service_waiting_for_callback" style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="436" alt="main_service_waiting_for_callback" src="http://blogs.oracle.com/rammenon/WindowsLiveWriter/BPELCorrelationwithinFlowN_5E4/main_service_waiting_for_callback_thumb.jpg" width="495" border="0" /></a> </p>  <p>3. Invoke the ReaderService [the service that calls back the main service] with one callback message.</p>  <p><a href="http://blogs.oracle.com/rammenon/WindowsLiveWriter/BPELCorrelationwithinFlowN_5E4/reader_service_invoke.jpg"><img title="reader_service_invoke" style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="375" alt="reader_service_invoke" src="http://blogs.oracle.com/rammenon/WindowsLiveWriter/BPELCorrelationwithinFlowN_5E4/reader_service_invoke_thumb.jpg" width="493" border="0" /></a> </p>  <p>4. Review the flow of the main service. It should have received one callback.</p>  <p>&#160;</p>  <p><a href="http://blogs.oracle.com/rammenon/WindowsLiveWriter/BPELCorrelationwithinFlowN_5E4/main_service_recvd_one_callback.jpg"><img title="main_service_recvd_one_callback" style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="451" alt="main_service_recvd_one_callback" src="http://blogs.oracle.com/rammenon/WindowsLiveWriter/BPELCorrelationwithinFlowN_5E4/main_service_recvd_one_callback_thumb.jpg" width="478" border="0" /></a> </p>  <p>&#160;</p>  <p>5. Submit the remaining messages from the ReaderService to complete the entire flow. The main process should complete execution following this.</p>  <p>&#160;</p>  <p><a href="http://blogs.oracle.com/rammenon/WindowsLiveWriter/BPELCorrelationwithinFlowN_5E4/main_service_recvd_all_callbacks.jpg"><img title="main_service_recvd_all_callbacks" style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="509" alt="main_service_recvd_all_callbacks" src="http://blogs.oracle.com/rammenon/WindowsLiveWriter/BPELCorrelationwithinFlowN_5E4/main_service_recvd_all_callbacks_thumb.jpg" width="477" border="0" /></a></p>]]></description>
         <link>http://blogs.oracle.com/rammenon/2008/10/bpel_correlation_within_flown.html</link>
         <guid>http://blogs.oracle.com/rammenon/2008/10/bpel_correlation_within_flown.html</guid>
        
        
         <pubDate>Tue, 28 Oct 2008 23:26:28 -0800</pubDate>
      </item>
      
      <item>
         <title>Re-submit BPEL instances from BAM</title>
         <description><![CDATA[<p><font face="Arial" size="2">Here is what I did for re-initiating BPEL instances from BAM. </font></p>  <p><font face="Arial" size="2">a) While defining the BAM sensor action, passed in the conversation Id of the instance [obtained using the xpath function ora:getConversationId()]     <br />b) Developed a Servlet that takes in a conversationId as a request parameter and initiates a new BPEL instance with the same input message.      <br />c) Created a table with an Action button that invokes the Servlet [using Open URL action] and passes in the conversationId.. The table contains columns that contain key identifiers for the transaction. [e.g. POId etc]      <br />d) At runtime, users select the rows in the table based on the identifiers and click on the action button - this will re-initiate the BPEL instance. </font></p>  <p><font face="Arial" size="2">Here is a snippet of code that does the trick.</font> </p>  <p><font face="Courier New" color="#0000ff" size="2"><em>&#160;&#160;&#160;&#160;&#160;&#160;&#160; IBPELDomainHandle domain = null;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; Locator locator = null;        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; String convId = request.getParameter(&quot;convId&quot;); </em></font></p>  <p><font face="Courier New" color="#0000ff" size="2"><em>&#160;&#160;&#160;&#160;&#160;&#160;&#160; Properties p = new Properties();       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; java.net.URL url = ClassLoader.getSystemResource(&quot;context.properties&quot;);        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; p.load(url.openStream()); </em></font></p>  <p><font face="Courier New" color="#0000ff" size="2"><em>&#160;&#160;&#160;&#160;&#160;&#160;&#160; locator = new Locator(&quot;default&quot;,&quot;weblogic&quot;,p);       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; domain = locator.lookupDomain();        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; WhereCondition wc = new WhereCondition(&quot;conv_id=?&quot;);        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; wc.setString(1,convId);        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; IInvokeMetaData[] invMetadataArr = locator.listInvokeMessages(wc);        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; IInvokeMetaData invMetadata = invMetadataArr[0];        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; String messageGuid = invMetadata.getMessageGUID();        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; domain.recoverInvokeMessages(new String[]{messageGuid});</em></font></p>]]></description>
         <link>http://blogs.oracle.com/rammenon/2008/10/resubmit_bpel_instances_from_b.html</link>
         <guid>http://blogs.oracle.com/rammenon/2008/10/resubmit_bpel_instances_from_b.html</guid>
        
        
         <pubDate>Wed, 22 Oct 2008 16:21:35 -0800</pubDate>
      </item>
      
      <item>
         <title>Using Schematron within BPEL</title>
         <description><![CDATA[<p>I have developed a simple utility that validates an input document against a schematron file and returns a validation report that returns the status of validation, together with the list of assertions that failed.</p>  <p>The utlity is registered as an XPath function and can be invoked from within the XSL Mapper.</p>  <p>Here are the steps for using the utlity.</p>  <p>a) Download the jar file from <a href="http://blogs.oracle.com/rammenon/SchematronValidator.jar">http://blogs.oracle.com/rammenon/SchematronValidator.jar</a></p>  <p>b) Copy the file into $JDEV_HOME/jdev/lib/ext</p>  <p>c) Create a new file named “SchematronExtensionFunctions.xml” and&#160; copy the following content within it.</p>  <p>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;   <br />&lt;extension-functions&gt;    <br />&#160; &lt;functions xmlns:sch=&quot;<a href="http://www.oracle.com/XSL/Transform/java/com.oracle.xsl.xpath.sch.SchematronValidator&quot;">http://www.oracle.com/XSL/Transform/java/com.oracle.xsl.xpath.sch.SchematronValidator&quot;</a>&gt; </p>  <p>&#160;&#160;&#160; &lt;function name=&quot;sch:validateDocument&quot; as=&quot;node-set&quot;&gt;   <br />&#160;&#160;&#160;&#160;&#160;&#160; &lt;param name=&quot;schFileName&quot; as=&quot;string&quot;/&gt;    <br />&#160;&#160;&#160;&#160;&#160;&#160; &lt;param name=&quot;inputDoc&quot; as=&quot;node-set&quot;/&gt;    <br />&#160;&#160;&#160;&#160; &lt;/function&gt;&#160; <br />&#160; &lt;/functions&gt;    <br />&lt;/extension-functions&gt;.</p>  <p>Save the file onto the local file system.</p>  <p>d) Open JDev and navigate to Tools –&gt; Preferences –&gt; XSL Map.</p>  <p>e) Select the above file for the “User defined Extension Functions config file” and restart JDeveloper.</p>  <p>f) Create a new empty project/BPEL Project.</p>  <p>g) Add the following XSD into the project - <a title="http://blogs.oracle.com/rammenon/ValidationReport.xsd" href="http://blogs.oracle.com/rammenon/ValidationReport.xsd">http://blogs.oracle.com/rammenon/ValidationReport.xsd</a>. This XSD will define the report of errors if any during the schematron validation.</p>  <p>h)&#160;&#160;&#160; Also add the XSD for the document you wish to validate [if you havent added it yet]   <br /></p>  <p>i) Create a new XSL Map and choose the source as the input XSD in (h) and the target as the validationReport.xsd.</p>  <p>j) Choose “validateDocument” from the&#160; “User defined Extension functions” palette page of the component palette and drag it into the center pane.</p>  <p>k) Edit the parameters of the xpath function – the first argument is the absolute URL to the “.sch” file. The second argument should be the root element of the source document.</p>  <p>&#160;&#160; for instance, the generated XSLT for the mapping would look like’</p>  <p>&lt;xsl:copy-of select=&quot;sch:validateDocument('file:///localhost:7777/validations/po-validations.sch',/tns:po)&quot;/&gt;</p>  <p>Note the “copy-of” instead of “value-of” in the above expresion. When you drag and drop nodes into the center pane, the mapper will generate “value-of” statements. Manually change it to “copy-of”.</p>  <p>l) Test the map [note that the graphical view of the mapper might complain stating that &quot;&quot;copy-of&quot; is not supported. You can safely ignore this message, since this warning is only for limitations to graphical rendering of the construct.</p>]]></description>
         <link>http://blogs.oracle.com/rammenon/2008/10/using_schematron_within_bpel.html</link>
         <guid>http://blogs.oracle.com/rammenon/2008/10/using_schematron_within_bpel.html</guid>
        
        
         <pubDate>Mon, 20 Oct 2008 19:50:55 -0800</pubDate>
      </item>
      
      <item>
         <title>SOA Wishlist</title>
         <description><![CDATA[<p>Here are a few items in my wishlist. I will be adding my interests to this list as and when I catch something interesting.</p>

<p>a) A native BAM active viewer for iPhone. [Not on Safari].<br />
b) A Microsoft Outlook plugin for our workflow<br />
c) REST Services for BPEL/Other Consoles.<br />
d) MS Outlook integration for Worklist tasks.<br />
</p>]]></description>
         <link>http://blogs.oracle.com/rammenon/2008/10/soa_wishlist.html</link>
         <guid>http://blogs.oracle.com/rammenon/2008/10/soa_wishlist.html</guid>
        
          <category domain="http://www.sixapart.com/ns/types#category">Ideas</category>
        
        
         <pubDate>Tue, 14 Oct 2008 22:33:54 -0800</pubDate>
      </item>
      
      <item>
         <title>An attempt on 8 Queens Problem</title>
         <description><![CDATA[<p>I was trying out a different approach to 8-Queen's problem. I visualized each cell [that has a coordinate from (0,0) to (7,7) as a single number 10x + y. So you would have sort of an octal number set from 0 to 77. Each column would be 0-7, 10-17, 20-27 etc and so on till 70-77.<br />
Each row would be 0-70, 1 to 71 etc, in increments of 10. </p>

<p>7   17   27   37   47   57   67   77<br />
6   16   26   36   46   56   66   76<br />
5   15   25   35   45   55   65   75<br />
4   14   24   34   44   54   64   74<br />
3   13   23   33   43   53   63   73<br />
2   12   22   32   42   52   62   72<br />
1   11   21   31   41   51   61   71<br />
0   10   20   30   40   50   60   70</p>

<p>The solution was a recursive function that takes in  a current column index [ranging from 0 to 7], and computing the matching lists of size 8, after applying an exclusion rule.</p>

<p>The exclusion rule is interesting.<br />
For an item with value, lets say 43, the exclusion rule would test the row-wise, columnwise and diagonal collisions through a simple modulo-checking logic. The code is given below. Note that the code has not been subjected to any review, including self-review, though it generates the required 92 distinct permutations as the 8Q solution demands.<br />
<em><br />
package equeen;</p>

<p>import java.io.FileWriter;</p>

<p>import java.util.ArrayList;<br />
import java.util.List;<br />
import java.util.Stack;</p>

<p>public class EightQueens {</p>

<p>    public boolean computeMatches(int rowIndex, List matchedList) throws Exception{<br />
        if(matchedList.size() == 8) {<br />
          printToFile(matchedList);<br />
        }<br />
        boolean matched = false;<br />
        for(int i = 10*rowIndex ; i <= 10*rowIndex + 7 ; i++) {<br />
            int cellValue = i;<br />
            boolean isExcluded = computeExclusionRule(cellValue, matchedList);<br />
            if(!isExcluded) {<br />
                matched = true;<br />
                matchedList.add(cellValue);<br />
                if(computeMatches(rowIndex+1,matchedList)) matched = !matched;    <br />
            }<br />
        }</p>

<p>        if(!matched && matchedList.size() > 0) {<br />
            matchedList.remove(matchedList.size() - 1);<br />
            return true;</p>

<p>        }<br />
        else return false;<br />
    }</p>

<p>    private boolean computeExclusionRule(int value, List matchedList) {<br />
        for(int i = 0 ; i < matchedList.size() ; i++) {<br />
            int prevNumber = Integer.parseInt("" + matchedList.get(i));<br />
            int diff = (value - prevNumber);<br />
            if((diff % 9 == 0 && (prevNumber % 10 > value % 10)) ||<br />
               (diff % 10 == 0) || <br />
               (diff % 11 == 0 && (prevNumber % 10 < value % 10))) {<br />
              return true;<br />
            }<br />
        }<br />
        return false;<br />
    }<br />
    <br />
    public static void main(String[] args)  throws Exception {<br />
         EightQueens q = new EightQueens();<br />
         List emptyList = new ArrayList();<br />
         int ZEROTHCOLUMN_INDEX = 0;<br />
         long t = System.currentTimeMillis();<br />
         q.computeMatches(ZEROTHCOLUMN_INDEX,emptyList);<br />
         System.err.println("Number of ms for execution - " + (System.currentTimeMillis() - t));<br />
    }</p>

<p>    private static FileWriter fw = null;    <br />
    private static void printToFile(List matchedList) throws Exception {<br />
            if(fw == null) {<br />
                fw = new FileWriter("d:\\temp\\results.log");<br />
            }<br />
            String str = "";<br />
            for(int i = 0 ; i < matchedList.size() ; i++) {<br />
                int itemValue = Integer.parseInt("" + matchedList.get(i));<br />
                str += getCoords(itemValue) + " ";</p>

<p>            }<br />
            fw.write(str + "\r\n");<br />
            fw.flush();        <br />
    }<br />
    private static String getCoords(int cellValue) {<br />
        int x = cellValue/10;<br />
        int y = cellValue % 10;<br />
        return "(" + x + "," + y + ")"; <br />
    }<br />
    </p>

<p>}</em><br />
</p>]]></description>
         <link>http://blogs.oracle.com/rammenon/2008/06/an_attempt_on_8_queens_problem.html</link>
         <guid>http://blogs.oracle.com/rammenon/2008/06/an_attempt_on_8_queens_problem.html</guid>
        
        
          <category domain="http://www.sixapart.com/ns/types#tag">8 Queens</category>
        
          <category domain="http://www.sixapart.com/ns/types#tag">Algorithms</category>
        
         <pubDate>Mon, 30 Jun 2008 23:07:29 -0800</pubDate>
      </item>
      
   </channel>
</rss>
