Showing posts with label BusinessService. Show all posts
Showing posts with label BusinessService. Show all posts

Saturday, May 11, 2013

Service Versioning in OSB


             I was looking at different ways in which we can version the OSB services for my customer. It is a dilemma for all when you get requests for OSB changes due to system standardization like change in the proxy URLS to meet new standards/new functionalities where signatures will change of the exposed services. This issue can arise in any enterprise because when you start of initially without properly architecting the SOA services, not laying down proper standards and guidelines and. Going forward, there will be huge increase in services and how to manage all these services and consumers of these services will be always painstaking. In this article I will put down some points on the service versioning that can be done in OSB.
Backward Compatible changes
The types of changes that are backwards compatible are:
1.       Adding  new XML schema types to WSDL document that doesn’t affect existing schema types
2.       Adding new operations to an existing/new port type in WSDL document. These are basically new functionalities so will not affect existing consumers.
Not Backward Compatible changes
1.       Altering/Removing an operation that is currently consumed.
2.       Modifying the structure/parameters of existing data types
Versioning
All the artifacts need to be versioned at
1.       Namespaces - Unique namespaces to define the new version, usually implemented by mentioning version number.
2.       Folder structure - Separate folders for storing artifacts and folder name mentioning version.
On a high level I am listing the available options
         

Option1 :
If the consumer need not be affected and the new service is backward compatible, then we can deprecate the version1.0 and move on to the new version by changing the proxy service

Option2 :
If the consumer need not be affected and if the new service is not backward compatible, then its always better to maintain different versions of proxy service and have new consumers consume the new Version. When the old consumer is ready to upgrade and move to new version we can deprecate the v1.0 and shutdown the proxy service.




Option3:
This is scenario where there are signature changes and new functionalities required by consumer can be provided only  by modifying the signature then the only option is to work together with consumers and get the new version out which will include changes at consumer as well as provider. Its always better to number the releases so that you can track the service versions and easily identify references to deprecated older versions


I prefer the Option 2 it’s more easy and clean and doesn’t affect existing consumers. Option1 and Option3 are quite similar except that in Option3 the consumer is affected due to the endpoint change and consumer is aware about the version of the Service it’s consuming.
References :-

Monday, June 4, 2012

BPM11g-Getting started with BPMHelloWorld process-issues/workarounds

It has been some time that I got queries on how to get started on BPM .The best way to start on any technology or product stack is to do it the HelloWorld way. Always start with a hello world example.
I am using 11.1.1.1.6 environment for the examples.
There is a good step by step guide of getting started in BPM  @ link
To start up with you can just do the small part of getting the hello message /greeting and writing it to a file . In Jdev it will look like this.
 

The Request Hello in turn is implemented using a Human work flow activity, which receives in a HelloMessage and makes a service call which in turn calls a file adapter to write to a file.
Two activities between Start and End in BPM layer. The implementations of these 2 activities are done in SOA layer using Human work Flow and call to a file adapter.
I will list down some points/issues you may face doing this example
  •       The JDev Role matters, In case you select the BPM Role for Jdeveloper development, the implementation tab will be missing from your activities when you drill down. So if you want to the implementation in SOA then the Role must be default which gives access to both BPM and SOA together.
  •            During your development the main tab that yo will be using is the BPMProjectNavigator which will list the different components that will be part of your process.

  •        There are some chances the auto-create Task form may run into issues. So create the Task form again and delete previous UI project associated with the BPM process. 
  •            Once you compile/deploy BPM process, you will need to login to BPM workspace to view and initiate the process. The common issue is that The BPM process is not visible in th BPM workspace.  The User roles become pretty important in BPM. By default the Role of the Hello world activities will be tied to Role. You can change it to Requester or other role based on your process design.
These roles will now need to be mapped to users.
In case the process doesn’t show up you will have to check or create /modify users for roles.
The below screenshots show the configurations that need to be done on User roles in jdeveloper, EM and BPM workspace.
In jdeveloper
a)    Add the users to the roles used in the process/project.

In Oracle Enterprise Manager
a)    Expand the domain farm  and select  Application Deployments
b)    Select the deployed Application .Go to Security >Application Roles
c)    Add the <project name>.<rolename> and Users to the roles who can access the role.

In oracle BPM workspace
a)    Go to Administration tab >Roles
b)    Add the user to  <composite name>.<role name> members.
  •   In BPM workspace when you click on process to initiate the process for entering the Hello Message. The UI page throws an error .Page not found exception.
Error:  OracleJSP error: java.io.FileNotFoundException: Set the init-param debug_mode to "true" to see the complete exception message.

         The error is because adfc-config.xml refers to Empty1.jspx file.
    Create a empty jspx file and name it as Empty1.jspx , add below content in the file.
<?xml version='1.0' encoding='windows-1252'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
<jsp:directive.page contentType="text/html;charset=windows-1252"/>
<f:view>
<af:document id="d1">
<af:form id="f1"></af:form>
</af:document>
</f:view>
</jsp:root>
Once you add the file and redeploy the process the error will not recur.
Then you can enter all the hello message and submit the values, which in turn will make a service call to write a message to the file as specified in file adapter.
This is all some points I wanted to share with the newbies starting on BPM 11g
Hav a gr8 day ahead J

Friday, September 3, 2010

Follow HTTP redirects -OSB HTTP Transport Level setting


I started on the journey with Oracle service bus very recently even though I have been trying to catch this bus for a long time, but was never quite successful. It was quite different approach as considered to the more commonly used BPEL and ESB approach. Getting used to the Eclipse IDE, then exploring different options takes bit of your  time to get familiarized. But as always new journeys give us more opportunities to learn.
One of the first hurdles that came up was with testing the business service. The scenario goes like this. There is a web service exposed in one of our target systems which we tried to consume as a Business service from OSB. Developing the Business service is very straight forward, but testing it and making it work looked cumbersome. As part of testing we were encountering ‘Bad Request’ Error even though the payload was thoroughly tested using SOAP UI. The response code returns response code as 400 which meant that the request was not even reaching the web service.
What OSB gives us to debug the issue?
OSB Console test window will give you Response Document and Response Metadata using which you need to figure out the error.
Response Document returns
The invocation resulted in an error: Bad Request.
Response Metadata returns
<con:metadata xmlns:con="http://www.bea.com/wli/sb/test/config">
            <tran:headers             xsi:type="http:HttpResponseHeaders" xmlns:http="http://www.bea.com/wli/sb/transports/http" xmlns:tran="http://www.bea.com/wli/sb/transports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <http:Connection>close</http:Connection>
            <http:Content-Type>text/html; charset=iso-8859-1</http:Content-Type>
            <http:Date>Fri, 03 Sep 2010 05:11:17 GMT</http:Date>
            <http:Transfer-Encoding>chunked</http:Transfer-Encoding>
            </tran:headers>
            <tran:response-code   xmlns:tran="http://www.bea.com/wli/sb/transports">1</tran:response-code>
            <tran:response-message         xmlns:tran="http://www.bea.com/wli/sb/transports">Bad Request</tran:response-message>
            <tran:encoding           xmlns:tran="http://www.bea.com/wli/sb/transports">iso-8859-1</tran:encoding>
            <http:http-response-code         xmlns:http="http://www.bea.com/wli/sb/transports/http">400</http:http-response-code>
            </con:metadata>

So after a bit analysis and help from the Mohan the issue was found that the request was not getting forwarded to the external system and to ensure that the request gets forwarded to the end system  we need to enable  Follow HTTP redirects  setting . By default HTTP redirect will be disabled.
How to enable the HTTP redirect setting?
Go to HTTP Transport tab in the business service.biz file. Go to Advanced settings -> Enable Follow HTTP redirects

What Follow HTTP redirects setting does?
               A re-direct occurs when you send an outbound request to the URL of a business service, and that service returns a response code (for example, 302) that says the URL is no longer valid and this request needs to be sent to another URL. If the Follow HTTP Redirects check box is selected, Oracle Service Bus automatically re-sends the request to the new URL without any action on your part.
Note:
Another point to note is that 'chunked streaming mode' and 'follow HTTP redirects' setting cannot be enabled together. By default 'chunked streaming mode' will be enabled and HTTP redirects will be disabled. If you try to enable both settings of a business service, it will throw a compile time error mentioning
HTTP business service cannot have both 'chunked streaming mode' and 'follow HTTP redirects' options enabled.       
That’s it to start off with, m back to work J