Tuesday, January 28, 2014

OSB Service Pooling for high availability


High Availability is major usability for OSB. Consider we need to consume an 3rd party Billing service, consider billing service exposes three different endpoint URI for achieving hight availability. To make use of high avaiabily in the transport layer of OSB we can provide all three endpoint URI of 3rd party services.

Download Busines Service Source: https://drive.google.com/file/d/0B1o4dd3z33rESzJ2SC1SbkdhV28/edit?usp=sharing



Steps:
1. In the General tab point the 3rd party business service wsdl file

2. In the transport tab in default we will be seeing an end point uri once step 1 is completed. Since 3rd part has exposed three service we need to add additional two services endpoint uri.


3. Now need change the retry count. This is very important. Default value of this is zero. if its zero then it will just try to hit the first endpoint url and OSB wont try with other two endpoint uri! Hence we need to set this value to the required amount. Below example I have set to "1", it means if the first url fails then second url will be fired.


From Reference Docs:
You can define the retry option for business services. The retry option specifies the maximum number of times a business service can attempt to access endpoint URIs after an initial failure. For example, consider the behavior of a business service B with endpoint URIs eu1, eu2, and eu3, when the retry count is set to 1, 2, and 4.
When Retry Count = 1 – If business service B fails to process a request or is unable to access the endpoint URI eu1, it tries to process the request with eu2 (retry 1). If the retry fails then the business service returns failure. The business service does not retry the third endpoint URI eu3.
When Retry Count = 2 – If business service B fails to process a request or is unable to access the endpoint URI eu1, it tries to process the request with eu2 (retry 1). If the retry fails then the business service tries to process the request with eu3 (retry 2). If the retry fails then the business service returns failure.
When Retry Count = 4 – If business service B fails to process a request or is unable to access the endpoint URI eu1, it tries to process the request with eu2 (retry 1). If the retry fails then the business service tries to process the request with eu3 (retry 2). Then the business service waits for a interval you have configured for retry iteration interval (in seconds) before trying eu1 (retry 3). If this fails the business service retries eu2 (retry 4). If the retry fails then the business service returns failure.
If the retry count is set to 0, then the business service does not retry after the failure.
http://docs.oracle.com/cd/E23943_01/admin.1111/e15867/endpointurimgmt.htm
















Monday, January 27, 2014

WSDL nillable=true and minOccurs=1

In WSDL to mention the value of the element can be empty by using nillable=true.

XSD:
 <xs:element name="Gender" nillable="true" type="xs:string"/>

XML Data:
<Gender></Gender>

Above xml data is valid. Because gender value is empty which satisfies following conditions
1.  nillable=true
2. Default value of minOccurs=1, hence <Gender> element is accepted here.

Friday, January 17, 2014

OSB Sample for XQuery Transformation with XQuery Custom Function

In this example we are doing two things
1. Tranform the payload as per the business service
2. XQuery function is applied to insert the string "Dollar" for the price starts with "$" example if price is "$100" then amountType will be inserted with string "Dollar" else string "Rupees" is passed.

Proxy Service Request Payload:
<exam:Items xmlns:exam="http://www.example.org">
    <exam:Item>
        <exam:price>$100</exam:price>
    </exam:Item>
</exam:Items>


Business Service Payload:
<soapenv:Envelope  xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header  xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
</soap:Header>
<soapenv:Body>
<exam:products  xmlns:exam="http://www.example.org">
<exam:Item>
<exam:price>$100</exam:price>
<exam:amountType>Dollar</exam:amountType>
</exam:Item>
</exam:products>
</soapenv:Body>
</soapenv:Envelope>

Downlod OSB Proxy Sample Project

Solution For Oracle SOA SSL setup File Not Foud Exception

Solution to FabricProviderServlet during SSL certification setup, make sure that JKS file name with complete path is set for KeyStoreLocation property instead of setting jks path alone. This will fix the below issue.


####<Jan 17, 2014 2:31:29 PM IST> <Error> <Deployer> <INBLRL3497> <AdminServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <0000KEVQSHTComo5SVP5ic1IqEzd000002> <1389949289542> <BEA-149231> <Unable to set the activation state to true for the application 'soa-infra'.
weblogic.application.ModuleException: [HTTP:101216]Servlet: "FabricProviderServlet" failed to preload on startup in Web application: "/soa-infra".
oracle.fabric.common.FabricException: Unable to create SSL Socket Factory: C:\Oracle\Middleware\home_11g\user_projects (Access is denied)
    at oracle.integration.platform.common.SSLSocketFactoryManagerImpl.getSSLSocketFactory(SSLSocketFactoryManagerImpl.java:74)
Caused By: java.io.FileNotFoundException: C:\Oracle\Middleware\home_11g\user_projects (Access is denied)

XQuery - Solution for "unbound current node is not supported for XQuery resources"

When below error occurs please check whether the string constant is enclosed with single quate(') such that it can be parsed by the XQyuery compiler

Multiple markers at this line - An error occurred compiling the XQuery resource: The use of an unbound current node is not supported for XQuery resources

Simple XQuery function example with constant and if else condition:

declare function xf:passCurrency(
    $price as xs:string)
    as xs:string {
   
    return if (fn:starts-with($price,"$"))
       then 'Dollar'
       else 'Ruppes'

};

Friday, January 10, 2014

Oracle Service Bus - Example for Service Callout and XQuery Transformation - Using Variable across the stages

Simple OSB example to illustrate Service Callout and XQuery Transformation.

Aim: In OSB to call an service which has two arguments, first argument is coming as a input to the OSB and second argument need to receive from an service callout


I'm attaching the OSB sample project and soup ui project with thins blog.

Please import the project and then check below points. Below explanation is concentrated on proxy rather than business service. As Business service is straight forward.

There are two steps in this sample, step 1 is making a service callout of  "GetWeatherInformation" and then route it to "GetCityWeatherByZip"

service callout:
We are constructing the payload for GetWeatherInformation method using assign statement. In assign vaiable "serviceCallOutRequestVariable" we are assigning the request payload of GetWeatherInformation

<weat:GetWeatherInformation xmlns:weat="http://ws.cdyne.com/WeatherWS/"/>

Hint:We can get the request payload of GetWeatherInformation by executing the business service of GetWeatherInformation in EM.

Routing:
After getting the required information in the variable now we need to construct the payload for the routing service.

Uisng XQuery we transform the source data to the destination formation and then insert the additional information which we received from the service callout. With the constucted payload route to the GetCityWeatherByZip


Download SOUP UI Project for OSB Sample

Download OSB Sample Project

Thursday, December 26, 2013

OSB References

1. Quick Start Guide for various service composition in OSB:
http://docs.oracle.com/cd/E23943_01/doc.1111/e15020/service_composition.htm

2. Quick Start Example for OSB, just download and import to OEPE
https://java.net/projects/oraclesoasuite11g/pages/OSB