Wednesday, August 31, 2011

Replace / rename namespace in OSB

I have an input schema without a name space, like <a><b><c>blah</c></b></a>.

I need to convert it into <a xmlns="http://x.y.com/z"><b><c>blah</c></b></a>. Beware this is equavilant to <foo:a xmlns:foo="http://x.y.com/z"><foo:b><foo:c>blah</foo:c><./foo:b></foo:a>

I have tried various ways, including use "fn-bea:serialize($arg-items)" and "contact()", just couldn't make it work. I found my solution by browsing online. then trial and error.

First of all, you can always use XSLT to transalte to new namespace. But I want to use the built-in activites to do it.

My answer is to use "rename" activity.

In my case, I put in

XPath: ".//*"
In Variable: myVar (which contains the source XML)
localname: (leave it empty)
Namespace: http://x.y.com/z"

This will take care of all elements of <b> and down. So you I have to do another rename, just for <a> (If you are wondering, I actually tried XPath: "//*". It didn't work).

So for the 2nd rename:
XPath: "."
In Variable: myVar (which contains the source XML)
localname: (leave it empty)
Namespace: http://x.y.com/z"

I'm quite sure you can do (or leave xpath as ".")
XPath: "./a"
In Variable: myVar (which contains the source XML)
localname: a
Namespace: http://x.y.com/z"

Monday, August 29, 2011

An Oracle standard DB install issue with OracleMTSRecoveryService

I got too busy with work, lots things happened that I should post it here. Let me start with a small one.

During Oracle 11g DB (standard version) install, I run into an error, "Error in starting the service. The service OracleMTSRecoveryService was not found".

If I check the service panel, i can see this:

I ignored it a few times. Then I decided to take a closer look and found a work around. here is my solution.
When this error box pops up, keep it there. Fire up regedit go to "computer\hkey_local_machine\system\controlset001\service\OracleMTSRecoveryService". Double click on ImagePath, then change the path to where your Oracle is actually installed.

In my case, the ImagePath has a value of
C:\Oracle\product\11.2.0\dbhome_1\bin\omtsreco.exe "OracleMTSRecoveryService"
I had to change it to:
C:\app\myaccount\product\11.2.0\dbhome_1\bin\omtsreco.exe "OracleMTSRecoveryService"

then click on "retry". that solved my problem.

You may need to look around to see where your DB is actually installed. By defatul, it is installed under "c:\app\yourAcctName".