Friday, December 11, 2015

Oracle SOA BPEL FTP Pooling File (Weblogic Admin Console & BPEL code)

First Create a connection for FTPAdaptor as we do it for DBAdaptor in weblogic admin console.

Open weblogic console http://<yourhost>:<port>/console
- Go to deployment (left menu)
- Go to FtpAdapter  -> Configuration -> Outbound Connection Pool


Important part is adding following properties for the above created ftp connection.
 listParserKey: change it from UNIX to WIN
You must change following : host, password, serverType (win for windows, unix for unix system), username


BPEL Design:


-








Just to transfer the file to you can select the opaque option instead of constructing the schema.

Download sample source code from here: 







Thursday, April 23, 2015

Oracle SOA BPEL Secure the service by HTTPS and Token

Webservice which is exposed to the outer world is need to be secured by two important ways 
1. Policy enforces message protection ie, to pass the payload in encryted and signed form in the network
2. Authentication for inbound SOAP requests ie., to prevent the access of webservice from unauthorised people to access it.
To complete this task we need to accompliss three tasks
Task 1: Create a BPELprocess which is secured
Task 2: Create Keystore with keypair and certificates
Task 3: Configure the EM with the created key store.
Task 4: Test the secure BPEL service

Task 1: Create a BPELprocess which is secured

Lets create a Oracle BPEL service is exposed as secured service
1. I have just created a simple BPEL service which just echo the data which is passed to the service. But this BPEL is secured by using WS-Security policy. Lets see the screenshots to constructs the secured service through JDeveloper during design time.

2. Right click the exposed service which need to be secured and select WS policy


3. Select oracle/wss11_username_token_with_message_protection_service_policy policy, this policy enforces message protection (integrity and confidentiality) and authentication for inbound SOAP requests in accordance with the WS-Security 1.1 standard. Both plain text and digest mechanisms are supported.

4. Deploy the service in the Weblogic Domain.
If we test this service directly, the service will fail as we didn't set the keystore in weblogic server.
Task 2: Create Keystore with keypair and certificates:
1. Create a self-signed certificate and keystore with one single command below. Here the password is set as 'password' for the keystore and encryption
keytool -genkey -keyalg RSA -alias selfsigned -keystore keystore.jks -storepass password -validity 360 -keysize 2048
2. With below command we can see what is present inside the created keystore
keytool -list -v -keystore keystore.jks
Task 3: Configure the EM with the created key store:
1. Login to EM and navigate to keystore of the domain


2. Select Keystore configuration
3. Replace the default jks file with created keystore file. 
   "selfsigned" is the alais value for key and crypt alias
    "password" is the password for the both the entry

4. Click OK and restart the server.

Task 4: Test the secure BPEL service

1. Navigate to the deployed bpel service and click test button in EM
2. select securing and OWSM security option
3. select wss11_username_token_with_message_protection_client_policy
4. Enter weblogic username and password for authentication
5. Click test webservice button. It should be successfully.




Thursday, April 9, 2015

JMS Destination JCA-12141 CONN_FAC_NOT_FOUND



The JCA Binding Component was unable to establish an outbound JCA CCI connection due to the following issue: BINDING.JCA-12141 ERRJMS_CONN_FAC_NOT_FOUND.


Rootcause: Basically remote jms server is not able to be connected from soa server.

We have used tcp connection to connect to the remote server.
SOA server is not able to connect to <destination url>  through TCP via port number 3035 where as same url was accessible from SOA prod server. Hence test-case was failed in Pre-Prod. Network team can check why tcp connection to the destination is not getting connected.

Friday, March 6, 2015

Error: Message part element undefined in wsdl

Error: Message part element undefined in wsdl

java.lang.Exception: Message part element undefined in wsdl part name = payload type = ClaimResponse


Resolution: Check the wsdl file's input or output element's part. Part shuld be undefined. If you use JDeveloper, then in design view explanatory symbol will be displayed in part section of input which indicate that part is undefined. Fix the schema to fix this issue

Creating XML Scema with List of complex type (List of Employees or List of Records)



Creating XML Scema with List of complex type (List of Employes or List of Records)


Below XML is the schema for sample list of claims. Check the video below for more detail

<?xml version="1.0" encoding="windows-1252" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns="http://www.example.org"
            targetNamespace="http://www.example.org"
            elementFormDefault="qualified">
  <xsd:complexType name="ClaimRequestType">
    <xsd:sequence maxOccurs="unbounded">
      <xsd:element name="Claim" type="ClaimType"/>
    </xsd:sequence>
  </xsd:complexType>
  <xsd:complexType name="ClaimType">
    <xsd:sequence>
      <xsd:element name="id"/>
      <xsd:element name="claimId"/>
    </xsd:sequence>
  </xsd:complexType>
  <xsd:element name="claimRequest" type="ClaimRequestType"/>
  <xsd:complexType name="ClaimResponseType">
    <xsd:sequence>
      <xsd:element name="ClaimResponse" type="ClaimResponseType"/>
    </xsd:sequence>
  </xsd:complexType>
  <xsd:complexType name="ClaimResponse">
    <xsd:sequence>
      <xsd:element name="id"/>
      <xsd:element name="status"/>
      <xsd:element name="amount"/>
    </xsd:sequence>
  </xsd:complexType>
</xsd:schema>





Monday, December 8, 2014

Oracle SOA MDS - Adding and updating MDS from JDeveloper


Lets examine how to create a MDS repository for new project. We need to following steps for creating and updating MDS

Adding files to MDS:
Step 1: Run RCU by checking the MDS which will create required tables for MDS

Step 2: Create MDS db connection from JDeveloper

Step 3: Create jar file in Jdeveloper and have all the required resources to be uploaded to MDS. (Will provide screenshot and explain it later)

Step 4: Deploy the Application (not jar project created in step 1!)

Step 5: Refresh the MDS DB in Jdeveloper, you will see all the required files.

Updating MDS Files:
Step 1: First download the MDS files from the EM to the jar project which was created in step 1 above.

To download mds file navigate to:
soa-infra -> Adminstration -> MDS Configuration  -> and then on the right side of the screen: Import.

Step 2: Update the any file in the jar file and add additional schemas/wsdl.

Step 3: Deploy the Application. Done
-----------------------------------------------------------------------------------------------------------------
Step 3 of creating jar file with soa-bundle is explained Antony  here

Creating Shared Resources in a JDeveloper Project

First lets create a JDeveloper project and put our shared resources into that project.  To do this
  1. In a JDeveloper Application create a New Generic Project (File->New->All Technologies->General->Generic Project)
  2. In that project create a New Folder called apps (File->New->All Technologies->General->Folder) – It must be called apps for local File MDS to work correctly.
  3. In the project properties delete the existing Java Source Paths (Project Properties->Project Source Paths->Java Source Paths->Remove)
  4. In the project properties a a new Java Source Path pointing to the just created apps directory (Project Properties->Project Source Paths->Java Source Paths->Add)
    JavaSourcePaths
Having created the project we can now put our resources into that project, either copying them from other projects or creating them from scratch.

Create a SOA Bundle to Deploy to a SOA Instance

Having created our resources we now want to package them up for deployment to a SOA instance.  To do this we take the following steps.
  1. Create a new JAR deployment profile (Project Properties->Deployment->New->Jar File)
  2. In JAR Options uncheck the Include Manifest File
  3. In File Groups->Project Output->Contributors uncheck all existing contributors and check the Project Source Path
  4. Create a new SOA Bundle deployment profile (Application Properties->Deployment->New->SOA Bundle)
  5. In Dependencies select the project jar file from the previous steps.
    SOABundle
  6. On Application Properties->Deployment unselect all options.
    SOABundle2
The bundle can now be deployed to the server by selecting Deploy from the Application Menu.

Create a Database Based MDS Connection in JDeveloper

Having deployed our shared resources it would be good to check they are where we expect them to be so lets create a Database Based MDS Connection in JDeveloper to let us browse the deployed resources.
  1. Create a new MDS Connection (File->All Technologies->General->Connections->SOA-MDS Connection)
  2. Make the Connection Type DB Based MDS and choose the database Connection and parition.  The username of the connection will be the <PREFIX>_mds user and the MDS partition will be soa-infra.
Browse the repository to make sure that your resources deplyed correctly under the apps folder.  Note that you can also use this browser to look at deployed composites.  You may find it intersting to look at the /deployed-composites/deployed-composites.xml file which lists all deployed composites.
DbMDSbrowse

    Create an File Based MDS Connection in JDeveloper

    We can now create a File based MDS connection to the project we just created.  A file based MDS connection allows us to work offline without a database or SOA server.  We will create a file based MDS that actually references the project we created earlier.
    1. Create a new MDS Connection (File->All Technologies->General->Connections->SOA-MDS Connection)
    2. Make the Connection Type File Based MDS and choose the MDS Root Folder to be the location of the JDeveloper project previously created (not the source directory, the top level project directory).
      FileMDS
    We can browse the file based MDS using the IDE Connections Window in JDeveloper.  This lets us check that we can see the contents of the repository.

    Using File Based MDS

    Now that we have MDS set up both in the database and locally in the file system we can try using some resources in a composite.  To use a WSDL from the file based repository:
    1. Insert a new Web Service Reference or Service onto your composite.xml.
    2. Browse the Resource Palette for the WSDL in the File Based MDS connection and import it.
      BrowseRepository
    3. Do not copy the resource into the project.
    4. If you are creating a reference, don’t worry about the warning message, that can be fixed later.  Just say Yes you do want to continue and create the reference.
      ConcreteWSDLWarning
    Note that when you import a resource from an MDS connection it automatically adds a reference to that MDS into the applications adf-config.xml.  SOA applications do not deploy their adf-config.xml, they use it purely to help resolve oramds protocol references in SOA composites at design time.  At runtime the soa-infra applications adf-config.xml is used to help resolve oramds protocol references.
    The reason we set file based MDS to point to the project directory rather than the apps directory underneath is because when we deploy SOA resources to MDS as a SOA bundle the resources are all placed under the apps MDS namespace.  To make sure that our file based MDS includes an apps namespace we have to rename the src directory to be apps and then make sure that our file based MDS points to the directory aboive the new source directory.

    Patching Up References

    When we use an abstract WSDL as a service then the SOA infrastructure automatically adds binging and service information at run time.  An abstract WSDL used as a reference needs to have binding and service information added in order to compile successfully.  By default the imported MDS reference for an abstract WSDL will look like this:
    <reference name="Service3"
       ui:wsdlLocation="oramds:/apps/shared/WriteFileProcess.wsdl">
      <interface.wsdl interface="
    http://xmlns.oracle.com/Test/SyncWriteFile/WriteFileProcess# wsdl.interface(WriteFileProcess)"/>
      <binding.ws port="" location=""/>
    </reference>
    Note that the port and location properties of the binding are empty.  We need to replace the location with a runtime WSDL location that includes binding information, this can be obtained by getting the WSDL URL from the soa-infra application or from EM.  Be sure to remove any MDS instance strings from the URL.
    EndpointInfo
    The port information is a little more complicated.  The first part of the string should be the target namespace of the service, usually the same as the first part of the interface attribute of the interface.wsdl element.  This is followed by a#wsdl.endpoint and then in parenthesis the service name from the runtime WSDL and port name from the WSDL, separated by a /.  The format should look like this:
    {Service Namespace}#wsdl.endpoint({Service Name}/{Port Name})
    So if we have a WSDL like this:
    <wsdl:definitions
       …
       
    targetNamespace=
       "http://xmlns.oracle.com/Test/SyncWriteFile/WriteFileProcess"
    >
       …
       <wsdl:service name="writefileprocess_client_ep">
          <wsdl:port name="WriteFileProcess_pt"
                binding="client:WriteFileProcessBinding">
             <soap:address location=… />
          </wsdl:port>
       </wsdl:service>
    </wsdl:definitions>
    Then we get a binding.ws port like this:
    http://xmlns.oracle.com/Test/SyncWriteFile/WriteFileProcess# wsdl.endpoint(writefileprocess_client_ep/WriteFileProcess_pt)
    Note that you don’t have to set actual values until deployment time.  The following binding information will allow the composite to compile in JDeveloper, although it will not run in the runtime:
    <binding.ws port="dummy#wsdl.endpoint(dummy/dummy)" location=""/>

    The binding information can be changed in the configuration plan.  Deferring this means that you have to have a configuration plan in order to be able to invoke the reference and this means that you reduce the risk of deploying composites with references that are pointing to the wrong environment.

    Tuesday, November 25, 2014

    Advantage of Oracle AIA for Error Handling notification



      Oracle Application Integration Architecture (AIA) delivers Pre-built services which can be reused in custom application.

      Error Handling is one of the AIA pre-build application, this service can be used in our custom composite to handle fault such that we can achive various advantages some of them are

      1. Achieving a canonical form of error handling across the system.
      2. For an fault we can trigger an email asynchronously.  Such that we can offload(loosely couple) email trigger functionality from our application.