Kavin's SOA Blog

April 15, 2009

configuring Oracle Enterprise Registry (Harvester) with JDeveloper

  1. Copy the Harvester plug-in OER103-SOA-BPM-Harvester.zip located at <BEA_HOME>/repository103/core/tools/solutions under <JDEV_HOME>.
  2. Unzip the zip file with option “extract here”.

    image

  3. Check if a new folder “introspector” is created under <JDEV_HOME> folder. If not verify how you unzipped.
  4. Open the tools.xml file in <JDEV_HOME>\introspector in a text editor. Copy all the elements between the <tools> and </tools> elements and paste in tools.xml file in <JDEV_HOME>\jdev\system\oracle.jdeveloper.10.1.xxxxx and save it.
  5. Launch Oracle JDeveloper and click Tools > External Tools. You should be able to see two harvester menu items image
  6. To edit a Harvester item, select it and click Edit. In the Edit External Tool dialog box, edit the repository.url, repository.username, and repository.password properties to set the Oracle Enterprise Repository URL, username, and password. image
  7. To submit an item in the External Tools dialog box to Oracle Enterprise Repository, select it and click OK. Remember to import OER103-SOA-BPM-Suite-Solution-Pack in Oracle Enterprise Repository before exporting assets to OER

image

March 12, 2009

Creating copy of JDeveloper BPEL Project

Filed under: Development — Tags: , , , , — Kavin @ 5:35 pm

Out of the box, JDeveloper provides couple of templates (Synch and Asynch) for developing BPEL process. However, in real world scenarios, especially within matured SOA environments, you will need to have basic standards like fault handling, notification features built in. In such a case you have a option to use “custom template” option of JDeveloper where you build a BPEL project based upon standards and then mark this project as template. Once you do so JDeveloper will give you that project as an option while selecting template for BPEL project. However this option is little bit flaky. Many times I experienced that new project doesn’t have all the artifacts. So I came up with a small ANT task which serves the purpose. You simply paste this snippet inside your build.xml which JDeveloper creates for your out of box.

<target name="copyProject">
        <property name="sourceDir" value="${basedir}"/>
        <property name="sourceProject" value="${BPELSuitcase.BPELProcess(id)}"/>
        <echo> Step 1: Set target directory and project name</echo>
            <input message="Please enter target directory:" addproperty="targetDir"/>
            <input message="Please enter project names:" addproperty="projectName"/>
            <property name="sourceWSDLNamespace" value="http://otn.oracle.com/samplenawsdlmespace"/>
            <property name="sourceSchemaNamespace" value="http://otn.oracle.com/sampleschemanamespace"/>

            <input message="Please enter target WSDL namespace:" addproperty="targetWSDLNamespace"/>
            <input message="Please enter target Schema namespace:" addproperty="targetSchemaNamespace"/>

        <property name="projectDir" value="${targetDir}/${projectName}"/>

        <echo> Step 2: Copy files from template to New Project </echo>
            <copy todir="${projectDir}" verbose="true" includeemptydirs="false"
                overwrite="false">
                <fileset dir="${sourceDir}">
                    <exclude name="**/output/**"/>
                    <exclude name="**/*.bak"/>
                </fileset>
            </copy>

        <echo> Step 3: Renaming Files </echo>
            <move file="${projectDir}/${sourceProject}.jpr"
                tofile="${projectDir}/${projectName}.jpr" verbose="true"/>
            <move file="${projectDir}/bpel/${sourceProject}.wsdl"
                tofile="${projectDir}/bpel/${projectName}.wsdl" verbose="true"/>
            <move file="${projectDir}/bpel/${sourceProject}.bpel"
                tofile="${projectDir}/bpel/${projectName}.bpel" verbose="true"/>
            <move file="${projectDir}/bpel/${sourceProject}.xsd"
                tofile="${projectDir}/bpel/${projectName}.xsd" verbose="true"/>
            <replace dir="${projectDir}" token="${sourceProject}" value="${projectName}"
                   summary="true"/>

        <echo> Step 4: Replacing Namespaces </echo>
            <replace dir="${projectDir}" token="${sourceWSDLNamespace}" value="${targetWSDLNamespace}"
                   summary="true"/>
            <replace dir="${projectDir}" token="${sourceSchemaNamespace}" value="${targetSchemaNamespace}"
                   summary="true"/>
     </target>

It simply accepts 4 parameters

  1. Target Directory – It’s the directory where your project will be places e.g. c:\projects
  2. Project Name – Name of your BPEL project, also a folder will be created under your target directory folder you mentioned above e.g. c:\projects\sampleProject1
  3. Target WSDL Namespace – This will be target namespace of WSDL in new project.
  4. Target Schema Namespace – This will be target namespace of schema in new project.

Apart from that you have two more variables which you need to set i.e.

  1. Source WSDL Namespace – WSDL target namespace of your source project.
  2. Source Schema Namespace – Schema target namespace of your source project.

Once you complete this, you can simply run that target and you are good to go.

image

March 10, 2009

Top Down web service in JDeveloper BPEL Projects

Filed under: Development — Tags: , , , , — Kavin @ 7:32 pm

Many a times its not possible to use the WSDL created by JDeveloper in BPEL project because of various reason like

  • SOA Governance standards
  • WSDL shipped by vendor or partner or third party application
  • etc.

For such reasons we have to develop our BPEL project in a slightly different way. Below I am presenting step by step guide to accomplish the above mentioned task. Hope this helps.

Select on Workspace > New Project > BPEL Process Project, click OK

image

Select Empty BPEL Process from “Template” top-down menu, Click Finish.

Please note that here I am selecting Empty BPEL process for the sake of simplicity, however you can follow pretty much the same steps in other templates (including custom templates). Idea is to create a partner like with custom WSDL and attach it with receive (or pick) activity.

image

You should now see an Empty BPEL Process with main scope and no activities

image 

Now move your mouse to “Services” swim lane and right click, Select “Create Partner Link”

image

For the test purpose, I am picking customerPartyMaster.wsdl shipped with OAGIS 9.2 model. I hosted that WSDL on web server to avoid hassles of maintaining references.

image

It will prompt you to create “Partner Link Types” section in WSDL, please select “Yes”.

imageThis will create a Ref WSDL which imports WSDL you specified and adds “Partner Link Type” section to it.

image

Now select the Partner Link Type, Partner Role and My Role.

image

Now drag “Receive” activity in your project. Point receive to “client”, this way your WSDL becomes the WSDL of your BPEL process. Select the operation you want to use for this BPEL project. If you want to make this BPEL multi-operation BPEL i.e. BPEL exposing more than one operatin, please use “Pick” activity to do so. Rest of the steps remains the same.imageClick on the “Wizard” icon to create InputVariable. It should automatically pick up data type based on the selected operation.

imageClick OK (on both create variable and Receive activity).

Now drag “Reply” activity to your project and point it to “client” partner link. Select the operation and create response variable for that.

image image

Now putting sample assign activity which maps one field of input variable to one in output variable

image

Click OK, your assign should look like this.

image

Click OK and your project should look like this

image 

This completes your BPEL process with custom WSDL. Now you should be able to deploy it and test it on BPEL server.

To test this project, would recommend using SOAP UI for testing. Testing page shipped with application is not always reliable. SOAP UI is still gold standard for me.

image

Check endpoint property for the port and operation which we used for the project

image

Create new request for the operation which we used in BPEL and pick the right endpoint location from the dropdown.

image

Prepare the request and send it to BPEL Server

image 

Response from the BPEL process.

image

This completes our exercise.

Theme: Shocking Blue Green. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.