Our book “Oracle Service Bus 11g Development Cookbook” has been added by Oracle to the “Learn More About Oracle Service Bus” section on OTN.
You can find it over here together with other usefull resources.
Short overview of some last week failing builds at our site ;) Since a while ago it's possible to register proxy repositories in Nexus based on the Oracle Maven Repository. To be able to proxy this repository you need to make use of an oracle account for the autenthication before you can download the artifact. Let's check the logging to understand what it does (i can rephrase the logfile or just copy/paste it ;), when others google for it it will find the hit much easier) [code language="xml"] 2016-11-11 15:17:54 INFO ...
Short overview of some last week failing builds at our site ;) Since a while ago it's possible to register proxy repositories in Nexus based on the Oracle Maven Repository. To be able to proxy this repository you need to make use of an oracle account for the autenthication before you can download the artifact. Let's check the logging to understand what it does (i can rephrase the logfile or just copy/paste it ;), when others google for it it will find the hit much easier) [code language="xml"] 2016-11-11 15:17:54 INFO ...
Short overview of some last week failing builds at our site ;) Since a while ago it's possible to register proxy repositories in Nexus based on the Oracle Maven Repository. To be able to proxy this repository you need to make use of an oracle account for the autenthication before you can download the artifact. Let's check the logging to understand what it does (i can rephrase the logfile or just copy/paste it ;), when others google for it it will find the hit much easier) [code language="xml"] 2016-11-11 15:17:54 INFO ...
Short overview of some last week failing builds at our site ;) Since a while ago it's possible to register proxy repositories in Nexus based on the Oracle Maven Repository. To be able to proxy this repository you need to make use of an oracle account for the autenthication before you can download the artifact. Let's check the logging to understand what it does (i can rephrase the logfile or just copy/paste it ;), when others google for it it will find the hit much easier) [code language="xml"] 2016-11-11 15:17:54 INFO ...
Short overview of some last week failing builds at our site ;) Since a while ago it's possible to register proxy repositories in Nexus based on the Oracle Maven Repository. To be able to proxy this repository you need to make use of an oracle account for the autenthication before you can download the artifact. Let's check the logging to understand what it does (i can rephrase the logfile or just copy/paste it ;), when others google for it it will find the hit much easier) [code language="xml"] 2016-11-11 15:17:54 INFO ...
Our book “Oracle Service Bus 11g Development Cookbook” has been added by Oracle to the “Learn More About Oracle Service Bus” section on OTN.
You can find it over here together with other usefull resources.
“Whip up a fresh batch of service- and message-oriented solutions with these recipes from the Oracle Service Bus 11g Development Cookbook”
Today two new items related to the Oracle Service Bus 11g Development Cookbook got published
OTN Article : Three Recipes for Oracle Service Bus 11g
Podcast Show Notes: Author Interview: Oracle Service Bus 11g Cookbook
On the 7th and 8th of februari i attended the Oracle Fusion Middleware Partner Community Forum in Malaga.
A 4 day during event with other Oracle colleagues from other companies and from Oracle itself.
After taking a early flight from Schiphol Amsterdam, we arrived on time in Malaga. Great weather, compared to the -12 degrees in The Netherlands.
The agenda for the 4 days
The first day started with the next list of session :
The day ended with the so called ‘Socal Network Event’. As usual Jurgen planned a great evening again for all of us.
Starting in El Pimpi restaurant with some drinks, delicious snacks and live music!
.. and to end up in Aleas Restaurant for a great dinner. Ideal moment to find out more about the new ps5/12c features and to finally get in contact with some friends of twitter.
The second day would be the more interested day with presentation about the new upcoming releases. Ideal to get in touch with the right persons and try to find out what’s coming up for us.
The interesting ones for me :
For the overall agenda see here.
The last 2 days we could follow the next hands-on trainings :
A list of upcoming features in one of the next minor upcoming releases (no guarantees, no dates!). Besides that some notes i made myself
SOA
OSB
JDeveloper
Weblogic
Overall a great event again.
Thanks go out to Jürgen Kress and Hans Blaas for organizing it!
Good news today from the publisher!
The book of which i’m coauthor of has been published! After months of hard work it’s finally there.
Oracle Service Bus 11g Development Cookbook : http://www.packtpub.com/oracle-service-bus-11g-development-cookbook/book
I hope you will all like it.
Thanks to the other authors (Guido, Edwin, Jan and Mischa) for all their hard work and for the great few months of working together to establish this great piece of work.
Special thanks go out to Guido for guiding the whole process of making this book. All the hours of hard work and organizing everything, i hope it was worth it!
Something about the book (which i nicely copy/pasted from Guido his blog)
The book contains more than 80 practical recipes to develop service- and message-oriented solutions on the Oracle Service Bus 11g.
This cookbook is full of immediately usable recipes showing how to efficiently develop on the Oracle Service Bus. In addition to its cookbook style, which ensures the solutions are presented in a clear step-by-step manner, the explanations go into great detail, which makes it good learning material for everyone who has experience with the OSB and wants to improve. Most of the recipes are designed in such a way that each recipe is presented as a separate, standalone entity and reading of prior recipes is not required. The finished solution of each recipe is also made available electronically.
The 80+ recipes are organized into the following chapters (the digit behind the title showing the number of recipes in that chapter):
Happy reading!
AMIS blog : Review of Oracle Service Bus 11g Development Cookbook (Packt Publishing) by Edwin Biemond, Guido Schmutz, Eric Elzinga et. al.
SOA@Oracle SCA, BPEL, BPM & Service Bus blog
One of the readers of my blog post ‘Oracle Service Bus 11g, Using Custom Xpath Functions asked we can reuse the custom xpath functions in a xsl transformation.
It’s possibel to reuse the jar and calll the custom functions from within a xsl transformation.
Starting with creating the resources needed for the custom xpath function :
Restart the osb service so the new jar will get loaded.
– Create a new osb project
– Create a new xslt
[sourcecode language=”xml”]
[/sourcecode]
To be able to call a custom xpath function with the Xalan engine we need to add a new namespace_prefix + definition the the xsl
[sourcecode language=”xml”]
xmlns:cust=”xalan://tests.pipeline.CustomXQFunctions”
[/sourcecode]
– Start with xalan://
– Then the java package + classname, nl.xenta.osb.custom.functions.OsbUtils
– In the select of the value-of we eventually use the namespace-prefix + java method interface to call the java method, cust:customConcat($param1,$param2)
Create a new proxy service and use the xsl in for example an assing activity.
Deploy the service and use the testconsole to test it.
In one of my xsl transformations i needed to import a generic xsl from the mds store.
For this i created a new jdeveloper application with a soa sar deployment descriptor and jar descriptor in it.
Contents of the jar :
[sourcecode language=”xml”]
SharedMDSResources/generic.xsl
[/sourcecode]
When i browse the mds repository i see the SharedMDSResources folder in the root of the tree (instead of in the apps folder).
For testing i deployed the jar manually in the EM.
In my xsl i use the next import :
[sourcecode language=”xml”]
[/sourcecode]
Resulting in the next stacktrace :
[sourcecode language=”xml”]
The following exception occurred while attempting to execute operation copy at line 389
This page contains the following errors:
Below is a rendering of the page up to the first error.
An error occurs while processing the XPath expression; the expression is ora:doXSLTransformForDoc(‘xsl/format_dates.xsl’, $csvXml).
The XPath expression failed to execute; the reason was: XML-22000: (Fatal Error) Error while parsing XSL file (oramds:/deployed-composites/default/mycomposite_rev1.0/xsl/my_process.xsl
Check the detailed root cause described in the exception message text and verify that the XPath query is correct.
[/sourcecode]
Since i deployed the jar manually from within the EM the SharedMDSResources folder will not be created in the apps-dir but in the root of the tree.
The oramds imports can only import from within the apps folder structure.
When manually creating the jar archive make sure the contributor has the apps-directory already in the path
Path : d:\SharedMDS\apps\SharedMDSResources\
After the import the mds repository will contain the path ‘oramds:/apps/SharedMDSResources/generic.xsl’
Or keep the jar as it was (folder/file structure = SharedMDSResources/generic.xsl) and use the scripts from for example Edwin and setup the ‘mds.reposistory’ correctly (ending with the apps-directory in it).
example topfragment of a xslt we currently use (this is not the xslt mentioned in the blog, but just a working example with oramds import)
[sourcecode language=”xml”]
[/sourcecode]
We would like to invite you to become updated and trained at our Fusion Middleware Partner Community Forum on February 7th and 8th 2011 at the NH Hotel in Malaga, Spain.
|
|
||
In the osb we use business services (http transport + wsdl) to call our composites on the soa suite.
In a few situations the routing in the osb fail with the next error
[sourcecode language=”xml”]
[/sourcecode]
Looking in the list of instances in the soa suite we see the instances over there just complete in a valid way but still the routing in the osb fails.
See also this blog for some extra explanation
For a usecase i needed a construction which would give me the option to implemenent generic service error handling in which i could conditionally execute activities like alerts, reports, logging, etc
One place which will contain all the error handling logic and which could be easily extended both in implementation of the logic for handling errors and being able to easily add new errors to be handle which the metadata for this error.
In case third party applications decide to trigger new type of exceptions/faults i don’t want to change the fault handling logic of all the process which do a call to this service. I want to be able to add the to be executed logic for this new specific error to some sort of error repository together with some setup-settings.
Definition of the error repository
In our case the error repository is nothing more then a xml metadata storage which stores settings for the errors to be handled.
The definition of the metadata can be extended with other settings which can be retrieved at one central place again and logic for handling the settings will also be centrally defined.
Definition of the error handling service
In our case the error handling service will be the central point in which we retrieve instance data from the process in which the occured fault.
Based on this data we will retrieve metadata for the fault and decide in the message flow handling what the logic will be to execute.
Schema definition
[sourcecode language=”xml”]
[/sourcecode]
The error handling proxy service will be the central point of executing location based on the incoming occured fault.
The input we will send to this service will be in the format of
[sourcecode language=”xml”]
{$body}
[/sourcecode]
The flow will eventually look something like this
Let’s look at the individual steps
The first step will contain 2 assigns.
The first assign will assign the ErrorRepository.xq to variable errorList
The content of the ErrorRepository.xq is the next
[sourcecode language=”xml”]
xquery version “1.0” encoding “Cp1252″;
(:: pragma type=”xs:anyType” ::)
declare namespace xf = “http://nl.xenta/services/errorRepository”;
declare function xf:service_error_handling()
as element(*) {
BEA-382505
BEA-380000
DEFAULT
};
xf:service_error_handling()
[/sourcecode]
At this point we have the list of faults together with metadata about what to execute when they occure available in the Message Flow.
In the second assign we retrieve only the the metadata from our occured fault, so we just retrieve 1 error-element from the list.
For this we execute the lookupError xquery which receives the errorList content and the errorCode and will return the error-element.
If we can’t retrieve any metadata based on the errorCode we will return a default set of metadata (the error-element of which the code = DEFAULT).
The result we will assign to the errorMetadataDetails variable.
Content of lookupError xquery
[sourcecode language=”xml”]
(:: pragma bea:global-element-parameter parameter=”$errorList” element=”err:service_error_handling” location=”ErrorRepository.xsd” ::)
(:: pragma bea:global-element-return element=”ns0:error” location=”ErrorRepository.xsd” ::)
declare namespace err = “http://nl.xenta/services/errorRepository”;
declare namespace xf = “http://nl.xenta/services/faults/lookupError/”;
declare function xf:lookupError2($errorCode as xs:string,
$errorList as element(err:service_error_handling))
as element(err:error) {
if(string-length($errorList/err:error[err:code=$errorCode]) > 0)
then (
let $resolvedError := $errorList/err:error[err:code=$errorCode]
return $resolvedError
) else (
let $resolvedError := $errorList/err:error[err:code=’DEFAULT’]
return $resolvedError
)
};
declare variable $errorCode as xs:string external;
declare variable $errorList as element(err:service_error_handling) external;
xf:lookupError2($errorCode,$errorList)
[/sourcecode]
In all the conditional stages we will now re-use the errorMetadataDetails variable to verify if we want to execute certain login.
If we configurated the indReporting=Y in the error repository xquery file then the if-then loginc will evaluate to the if-tree and the Report-activty will be executed.
In the same way all the other condition stages (conditionalAlert, conditionalSomethingElse) will work. We re-use the errorMetadataDetails-variable and just do a simple if-then check to see if certain logic needs to be executed.
The last step of the message flow is the step in which we construct the response of the errorHandler process back to the client process.
In this step we will be using Dynamic Xquery to be able the construct response messages based on the incoming fault.
The example of our ErrorReposity defines 2 faults and 1 default.
In case for example error BEA-380000 occures, we will use the xquery located at ErrorHandling/errorRepository/GenericFault_To_SOAPFault2 to be executed. This xquery will construct our soap fault.
To be able to use Dynamic Xquery all the to be used xquery transformations need to have the same interface. Depending on the backend system and the returning faults from it we will use different tranformation files.
But all of them will be using the input paramters ‘body, inbound and fault’. In the expression field we will use the faultTransformer-element from the errorMetadataDetails. So for every fault for which we want to create a
different fault response we do need to define a faultTransformer-value in the errorRepository.
And that’s all what is needed to implement in the errorHandler process to receive the metadata, handle the fault and construct the response.
For this testcase we created a simple EmployeeService. Create a new proxy service based on the next wsdl/xsd content.
[sourcecode language=”xml”]
[/sourcecode]
[sourcecode language=”xml”]
[/sourcecode]
And the message flow will eventually look like this
The first assign will assign the body to body_temp so in case of an error situation we still have the original body content stored
The second activity is the validation activity. This one we will be using lateron to trigger a fault which will be processed by the errorHandler process.
Based on the same wsdl as the proxy service i defined a new business service. In the EmployeeService proxy we will be routing to this business service.
Since we won’t be implementing any logic on this side we just update the endpoint of the business service to something useless so the route will fail on this one.
This part is used to the second fault triggering moment in our process. Also this situation will fail and the occured fault will get processed by the errorHandler.
The ‘normal’ message flow of our proxy service is now done.
Let’s have a look at the service error handler.
The first assign will use the next xquery and assign the result to errorhandler_request
[sourcecode language=”xml”]
xquery version “1.0” encoding “Cp1252″;
(:: pragma parameter=”$body” type=”xs:anyType” ::)
(:: pragma parameter=”$fault” type=”xs:anyType” ::)
(:: pragma parameter=”$inbound” type=”xs:anyType” ::)
(:: pragma type=”xs:anyType” ::)
declare namespace xf = “http://tempuri.org/ErrorHandling/proxy/constructErrorHandlingInput/”;
declare function xf:constructErrorHandlingInput($body as element(*),
$fault as element(*),
$inbound as element(*))
as element(*) {
{$body}
};
declare variable $body as element(*) external;
declare variable $fault as element(*) external;
declare variable $inbound as element(*) external;
xf:constructErrorHandlingInput($body, $fault, $inbound)
[/sourcecode]
In the binding we will use the body_temp variable so we have the original body content of the process.
The next activity is the service callout to the errorHandler process
The third activity is an assign which will assign the constructed body from the errorHandler process to the body variable
And the last activity will be a ‘Reply with Failure’
In the ErrorRepository we defined 2 faults, BEA-382505 and BEA-380000.
For both faults we defined a different faultTransformer.
BEA-382505 = ErrorHandling/errorRepository/GenericFault_To_SOAPFault
BEA-380000 = ErrorHandling/errorRepository/GenericFault_To_SOAPFault2
GenericFault_To_SOAPFault will return
[sourcecode language=”xml”]
(:
[/sourcecode]
GenericFault_To_SOAPFault2 will return
[sourcecode language=”xml”]
(:
[/sourcecode]
Deploy the process.
Now test the process either by using the testconsole of some testclient.
The first testcase will have a valid input message. So the process will pass the Validation activity and will fail when routing to the business service.
Since we used a non-existing host in here the process will trigger a BEA-380000 fault. As we defined in the errorRepository this errorCode will have the next set of metadata configured
[sourcecode language=”xml”]
BEA-380000
[/sourcecode]
The generated soap fault is correct. It contains the custom_details2-element, which is generated by the GenericFault_To_SOAPFault2 transformer.
Next check the sbconsole to see if there is also a report triggered for this error (indReporting=Y).
Next check the weblogic console to see if the alert got executed (indAlert=Y). For this one i created an alert with JMS Destionation.
For the second testcase we will use an invalid input message. The validation will throw an error (BEA-382505).
Check the generated soap fault (custom_details-element should get generated now).
And verify the alert and report too, to see if they got handled correctly.
In our xsd definition of the errorRepository we only defined a few settings just to show how it could work.
Eventually this model can be extend with every setting you need in your error handling processes. Since all the logic of reading those settings and decide what logic to execute is defined on only
one place, the errorHandler proxy service itself, it’s little work to extend the current logic for handlin the errors with new functionality. Just a new if-then activities for new settings and you’re ready to go.
The functionality as defined in the blog for handling the errors and creating a single point of error processing was enough for my testcase.
I needed all the logic on one place and not in every process. I needed a single place in which i could define all the errors i wanted to handle and what actions to execute when such an error occurs.
Besides that i needed a way in which other persons could easily add new defined errors to the file and the process would just ‘handle’ them without adding extra logic to processes.
In case you don’t want someone else to manipulate the errorRepository file directly from within the sbconsole itself we could also just read the content of this file from some other external location by use of the doc() function, see this blog.
I hope the solution described will help you a bit on implementation error handling in the Oracle Service Bus.
As i’m always keen on learning from others, please leave comments on how to make the implementation better, or if the solution is totally useless please say so too 🙂
download : OracleServiceBusGenericErrorHandling.zip
To be able to make use of Dynamic Xquery the xqueries itself all need to have the same defined interface.
So after defining the different xqueries and test them one by one in Eclipse all seem to work.
On runtime i get the next error :
[sourcecode language=”xml”]
The number of parameters for registered XQuery resource System1_To_Fault does not match that given to it at runtime
[/sourcecode]
I was pretty sure after logging all the binded input variables they were all containing data.
Lesson learned : Make sure you both bind all the variables but also ‘use’ them in the xquery itself.
OSB will return this fault either when you don’t bind all the variables but also if you don’t use all of them in the xquery
xquery1 fragment (will work):
[sourcecode language=”xml”]
xquery version “1.0” encoding “Cp1252”;
declare function xf:System1_To_Fault(
$metadata1 as xs:string,
$metadata2 as xs:string,
$metadata3 as xs:string)
as element(soapenv:Fault) {
};
declare variable $metadata1 as xs:string external;
declare variable $metadata2 as xs:string external;
declare variable $metadata3 as xs:string external;
xf:System1_To_Fault($metadata1, $metadata2, $metadata3)
[/sourcecode]
xquery2 fragment (will fail):
[sourcecode language=”xml”]
[/sourcecode]
inputvariable ‘metadata3’ isn’t used in the xquery itself, so the dynamix xquery will fail on runtime
either make sure you always use all the input variables in the xquery (or do an expression on it, for example assign it to an temp variable but don’t use it for generating your target xml)
something like this
[sourcecode language=”xml”]
let $temp := $metadata3
return
[/sourcecode]
I’m not sure what this assign will do (performance-wise) when you assign a big dom-tree variable, in that case you could just assign the deepest childnode to the temp variable.
Eventually it’s just a dirty fix to be able to use the xqueries in combination with dynamic xquery and still be able to not use all of the incoming parameters.