Thursday, February 21, 2013

Oracle SOA 11.1.1.6 Create RMA (Return Merchandise Authorization) using Oracle SOA B2B on AS2 Part 1

Oracle SOA 11.1.1.6: Create  RMA (Return Merchandise Authorization) using Oracle SOA B2B on AS2 (Part 1)

A return merchandise authorization (RMA) or return goods authorization (RGA) is the process of having a product repaired or replaced in order to receive a refund or credit for another product from the same retailer or corporation. This thread discusses creation of X12 180 ECS file Version 4010 using Oracle B2B Document Editor Tool version 7.0.5.




  • Using the B2B document Editor Shortcut, start the B2B document Editor. Click File->New




  • Choose X12 option under EDI, Choose Version 4010, Choose 180-Return Merchandise Authorization and Notification. Click Next.

  • Click Finish

  • Create an XSD so that we can configure B2B on Oracle SOA 11.1.1.6 stack. 
  • Click File. Choose Export.

  • In the Export Wizard, choose Oracle 2.0. Press Next.

  • Choose the folder where you want the XSD file to be created and Press Next.

  • Click Finish.

The ECS File and XSD file is ready. We we use these files in configuring the SOA - B2B using B2b Console in my next post.



OIM 11.1.1.5 : User Management


User Management

The OIM 11gR1 Java APIs support searching, creating, reading, updating and deleting of Users. This thread demonstrates cover how to use the OIM 11gR1 Java APIs to perform these operations.


Required server files

You will need to obtain the following files from the OIM 11gR1 server:
  • The OIM 11gR1 Java API classes are packaged as a jar file called oimclient.jar. This jar file is packaged within the oimclient.zip file. The oimclient.zip file is located in the OIM_ORACLE_HOME/server/client folder, on the OIM 11gR1 server.
  • Copy oimclient.zip from the OIM 11gR1 server:
    scp user@oimserver:/OIM_ORACLE_HOME/server/client/oimclient.zip .
  • Expand the oimclient.zip file:
    unzip oimclient.zip
  • Access the Weblogic Server system
    ssh user@wlserver
  • Change directories to the server/lib directory.
    cd WL_HOME/server/lib
  • Use the following command to create the wlfullclient.jar file in the server/libdirectory:
    java -jar wljarbuilder.jar
  • Copy the wlfullclient.jar file.

Create A User In OIM using OIM API.

package com.mindtelligent.oim.user.client;

import java.util.HashMap;

import oracle.iam.identity.usermgmt.api.UserManager;
import oracle.iam.identity.usermgmt.vo.User;
import oracle.iam.identity.usermgmt.vo.UserManagerResult;



public class UserCreate extends ClientUser
{
   public UserCreate() throws Exception
   {
      super();
      return;
   }
   public static void main(String[] args) throws Exception
   {

      UserCreate test = new UserCreate();

      try
      {
         test.execute();
      }
      catch (Exception ex)
      {
         test.log("EXCEPTION: " + ex.getMessage());
      }

      return;
   }
   protected void execute() throws Exception
   {
      long i = 1;
      String accountId = "hsaluja";
      String first = "Harvinder";
      String last = "Saluja";
      HashMap<String, Object> mapAttrs = null;
      UserManager umgr = null;         // OIMClient API
      UserManagerResult result = null; // OIMClient API
      User user = null;                // OIMClient API

      this.log("__BEGIN__");

      umgr = this.getUserManager();

      mapAttrs = new HashMap<String, Object>();
      mapAttrs.put("User Login", accountId);
      mapAttrs.put("First Name", first);
      mapAttrs.put("Last Name", last);
      mapAttrs.put("usr_password", "Passw0rd");
      mapAttrs.put("Email", first + "." + last + "@MindTelligent.com");
      mapAttrs.put("act_key", new Long(i));
      mapAttrs.put("Xellerate Type", "End-User");
      mapAttrs.put("Role", "Full-Time");  // User Type

   
      user = new User(accountId, mapAttrs);

      this.log("User object created: '" + accountId + "'");

      /*
       * Create the user
       */

      result = umgr.create(user);

      this.log("Creation status: '" + result.getStatus() + "'");

      this.log("__END__");

      return;
   }
}

Oracle SOA 11.1.1.6/ Weblogic 10.3.6: WLST Scripts to List Composites by Partions

Oracle SOA 11.1.1.6/ Weblogic 10.3.6: WLST Scripts to List Composites by Partions


sca_listCompositesInPartition is an online script taht can be used to display the composites in a partition. This script needs to be run from  $FW_Middleware\Oracle_SOA1\common\bin\wlst.cmd.

The script is supported by a properties file and the .py file (The script file).

The properties file looks has the following properties.


userName=weblogic
passWord=password
wlsHost=localhost
adminServerListenPort=7001
partitionsToBeChecked=default,partion1,partition2,partition3

The script itself is:

from java.io import FileInputStream
import re
import tempfile
propInputStream = FileInputStream("MonitorCompositesState.properties")
configProps = Properties()
configProps.load(propInputStream)

print '=============================================='
print '  COMPOSITE STATES WITH RESPECT TO PARTITIONS '
print '=============================================='
connect(configProps.get("userName"),configProps.get("passWord"),'t3://'+configProps.get("wlsHost")+':'+configProps.get("adminServerListenPort"))
splits=String(configProps.get("partitionsToBeChecked")).split(",")
for splitPartitionName in splits:
    print 'All the composites in partition:',splitPartitionName
    listcompos=sca_listCompositesInPartition(configProps.get("wlsHost"), configProps.get("adminServerListenPort"), configProps.get("userName"),configProps.get("passWord"),splitPartitionName) 
print '=============================================='
print''


Tuesday, February 5, 2013

Oracle SOA 11.1.1.6: WLST Scripts to Monitor Data Sources


This BLOG thread details the steps involved in creating WLST scripts to help to monitor the Data Sources on Weblogic Server with Admin Server or SOA  Server targets.

The scripts take advantage of a properties file which includes the server information. A file  CheckDataSourcesState.properties


userName=weblogic
passWord=password
wlsHost=localhost
adminServerListenPort=8001
dataSourcesToBeChecked=DataSourceDS1,DataSourceDS2



The WLST script can be created in an another file CheckDataSourcesState.py


import os
propInputStream = FileInputStream("CheckDataSourcesState.properties")
configProps = Properties()
configProps.load(propInputStream)
connect(configProps.get("userName"),configProps.get("passWord"),'t3://'+configProps.get("wlsHost")+':'+configProps.get("adminServerListenPort"))
serverRuntime()
dsMBeans = cmo.getJDBCServiceRuntime().getJDBCDataSourceRuntimeMBeans()
splits=String(configProps.get("dataSourcesToBeChecked")).split(",")
for ds in dsMBeans:
    for splitDSName in splits:
        if (splitDSName == ds.getName()):
              print 'DS name is: '+ds.getName()
              print 'State is ' +ds.getState()
              print ds.testPool()

Amazon Bedrock and AWS Rekognition comparison for Image Recognition

 Both Amazon Bedrock and AWS Rekognition are services provided by AWS, but they cater to different use cases, especially when it comes to ...