Monday, August 2, 2010

Installing Oracle SOA Suite 11g PS2 on Linux

Prerequisites

Note: If any of the above links are broken, just google and you will find the appropriate link.

Installation
1. Setup the Database
Use this link to install and configure Oracle XE on your machine. Then connect as SYS and run the following commands.
     alter system set processes=200 scope=spfile
     alter system set sessions=200 scope=spfile
Restart the DB

2. Repository Creation
1. Unzip the downloaded RCU zip file. 
2. Run ./rcu under RCU_HOME/bin directory
3. Follow the wizard and provide the DB details
4. In the Select Components Screen, select SOA and BPM Infrastructure and click next
5. In the Schema Password Screen, select Use same password for all schemas and provide a password
6. Select the defaults in the next screens and finish.

3. Install Weblogic Server
1. chmod +x the downloaded Weblogic Server bin file
2. Run the bin file
3. In the wizard, provide a mw_home for the server to be installed and the complete the installation with the defaults in the other screens.

4. SOA Suite 11.1.1.2
1. Unzip the appropriate zip file and run ./runInstaller. When prompted provide a JRE home.
2. Specify the mw_home where the server was previously installed.
3. Make sure the Oracle Home Directory is inside the mw_home
4. Finish the installation

5. SOA Suite 11.1.1.3 Patch
1. Unzip the appropriate zip file and run ./runInstaller. When prompted provide a JRE home.
2. Select the same Oracle Middleware Home and Oracle Home Directory as specified previously.
3. Finish the installation

6. Configure SOA Suite and Create Weblogic Domain
1. Navigate to SOA_ORACLE_HOME/common/bin and run ./config.sh
2. Select Create a New Weblogic Domain
3. In the Domain Source Screen, select Generate a domain configured automatically to support the following products, then select Oracle SOA Suite, Oracle Enterprise Manager, Oracle WSM Policy Manager, Oracle JRF WebServices Asynchronous services, Oracle JRF and Weblogic Advanced Web Services Extension.
4. In the next screen, provide a domain name and location and click next.
5. Provide the admin credentials to be set and click next.
6. Select the desired JDK  and click next.
7. In the Configure JDBC Component Schema Screen, provide the correct values for the DB Connections.
8. Complete the installation with the defaults.

Thursday, July 29, 2010

Oracle SOA 11g Human Task Query Service Remote Client

In my previous post I provided a link which has a sample code which uses the ITaskQueryService to query and act upon Human Tasks. The sample code provided over there used SOAP_CLIENT to establish connection to the server but if you wish to use the REMOTE_CLIENT below is the code snippet.


           WorkflowServicesClientConfigurationType wscct =
                new WorkflowServicesClientConfigurationType();
            wscct.setClientType(WorkflowServiceClientFactory.REMOTE_CLIENT);
            List servers = wscct.getServer();
            ServerType server1 = new ServerType();
            server1.setDefault(true);
            server1.setName("HcmSOAServer");
            servers.add(server1);

          
            RemoteClientType rct1 = new RemoteClientType();
            rct1.setServerURL("t3://ss-cmpq02.us.oracle.com:8001");
            rct1.setInitialContextFactory("weblogic.jndi.WLInitialContextFactory");
            rct1.setParticipateInClientTransaction(false);
            server1.setRemoteClient(rct1);

            IWorkflowServiceClient client =
                WorkflowServiceClientFactory.getWorkflowServiceClient(wscct, null);
            ITaskService taskSvc = client.getTaskService();
            ITaskQueryService taskQuerySvc = client.getTaskQueryService();          
            IWorkflowContext ctx = taskQuerySvc.authenticate("employee", "Welcome1".toCharArray(), "jazn.com");

Oracle SOA 11g Human Task Query Service

In Oracle SOA Suite 11g, a set of APIs are provided to query and act upon the Human Tasks programmatically. A sample code is provided in ITaskQueryService javadoc. In future if the link is broken just google for ITaskQueryService and most probably the first link would be the latest javadoc.

Wednesday, July 28, 2010

Navigating within Task Flow activities programmatically

Using the NavigationHandler Class we can programmatically navigate to a different activity based on an action within an ADF Task Flow. Sample code below:


    public void navBasedOnAction(String action){
        NavigationHandler navHndlr = FacesContext.getCurrentInstance().getApplication().getNavigationHandler();
         navHndlr.handleNavigation(FacesContext.getCurrentInstance(), null , "finish");
    }



Invoking Method Binding Programmatically

The following code snippet can be used to invoke a method binding programmatically from java:

public void invokeMB(String mBinding){
    FacesContext fctx = FacesContext.getCurrentInstance();
    ExpressionFactory ef = fctx.getApplication().getExpressionFactory();
    ELContext elCtx = fctx.getELContext();
    ValueExpression valueExp = ef.createValueExpression(elCtx,"#{bindings}",Object.class);
    JUFormBinding a = (JUFormBinding)valueExp.getValue(elCtx);
    OperationBinding op = (OperationBinding)a.getOperationBinding(mBinding);
    op.execute();
}

Invoking Web Services in Oracle ADF

There are two ways to invoke a Web Service in an ADF Application:
1. JAX-WS Proxy
2. Web Service Data Control

JAX-WS Proxy
Just by providing the wsdl to the Create WebService Proxy wizard you can easily generate the proxy to invoke the webservice. More details on this can be found on my earlier post.
Pros:
Gives more flexibility and control to the WebService consumer. The developer can create webservice request object and can invoke the webservice as required. The proxy can also be wrapped as a DataControl (right click on the client java file and select Generate Data Control) and used in ADF.
Cons:
Maintanence is hard. Generates many files to support the proxy and the proxy has to be regenerated if the WSDL stucture changes.

Web Service Data Control
In the New Gallery select Web Service Data Control and provide the wsdl location in the wizard to generate the Data Control. Once the DataControl is generated it can be used on like any other datacontrol and the webservice's operations can be performed in ease. For eg, a button click on a page / method on taskflow.
Pros:
Easy to create and use.
Cons:
Limited control over invoking the webservice.

Sunday, September 21, 2008

Web Service: Using Web Service Proxy

A tutorial on how to invoke a Web Service using Web Service Proxy in Jdeveloper 11g Technology Preview 4.



The application can be downloaded here.