Search This Blog

Wednesday, April 12, 2017

Read File As attachment from a File Adapter in SOA

Read File As attachment from a File Adapter in SOA








Attach a BPEL process to it with the BPEL code as

 <assign name="Assign1">
      <copy>
        <from expression="ora:getAttachmentContent('Receive1_Read_InputVariable','attach','/ns2:attachmentElement')"/>
        <to variable="Variable1"/>
      </copy>
    </assign>

++

Copy the file test1.xml to the directory /tmp/readattach1.

Open EM and go to the flow trace

for variable1 you should see the data as

<Variable1>
<Variable1  xsi:type="ns:string">PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiID8+Cjxwcm9jZXNzIHhtbG5zOnhzaT0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEtaW5zdGFuY2UiCiAgICAgICAgIHhzaTpzY2hlbWFMb2NhdGlvbj0iaHR0cDovL3htbG5zLm9yYWNsZS5jb20vQXBwbGljYXRpb24yL1Byb2plY3QzL0JQRUxQcm9jZXNzMSB4c2QvQlBFTFByb2Nlc3MxLnhzZCIKICAgICAgICAgICAgICAgICAgeG1sbnM9Imh0dHA6Ly94bWxucy5vcmFjbGUuY29tL0FwcGxpY2F0aW9uMi9Qcm9qZWN0My9CUEVMUHJvY2VzczEiPgogICAgICAgICAgICAgICAgICAgIDxpbnB1dD5SQVZJPC9pbnB1dD4KICAgICAgICAgICAgICAgICAgICA8L3Byb2Nlc3M+Cgo=</Variable1>
</Variable1>

This is in base64 encoded format








Tags: Publish
April 12, 2017 at 01:09PM
Open in Evernote

Thursday, April 06, 2017

How to debug OSB server remotely from Jdeveloper

How to debug OSB server remotely from Jdeveloper
For this you need to have a domain created in Development Mode and also if possible create a compact domain.

once this is done identify the DEBUG Port for OSB ,

cd /fmw11g/soa12212/user_projects/domains/osb_domain_cd/bin

find . -name "*" -print | xargs grep -i -l ALSB_DEBUG
./setStartupEnv.sh

find . -name "*" -print | xargs grep -i -l ALSB_DEBUG | xargs cat | grep ALSB_DEBUG

This shows the port as 7453. This is the remote port for the OSB.

Not down the machine name and the above port number.

Open the OSB project in jDeveloper and deploy this project.

Open the pipe line in OSB and set a break point

Right Click on the Project -> Project Properties
Click on Run/Debug 

Create a new Configuration with the name as OSB 




Ensure that remote debugging is set 


Specify the hostname and port


Click on OK and close the dialog boxes.


Click on OSB project 

Now this show's a dialog with debug port and hostname 


Click on OK and invoke the OSB Flow from SOAP UI or from the SB Console.

Now you can do single stepping and watch the variables etc.








Tags: Publish
April 06, 2017 at 12:57PM
Open in Evernote

Monday, April 03, 2017

OSB result Caching support in 11g with external coherence

OSB result Caching support in 11g with external coherence
OSB result Caching support in 11g




Created a simple SOA project with the simple helloworld that displays time+the input parameter you have passed.


for example

concat(xp20:current-dateTime(),bpws:getVariableData('inputVariable','payload','/client:process/client:input'))


Create a OSB project that calls this web service and enable the result cahcing for the business service.
Take this WSDL and import this to OSB and create a business service with this WSDL.

OSB Project 



Create a proxy service based on the business service.

Modify the file

\fmw11g\fmw1117\Middleware\user_projects\domains\soa_domain\config\osb\coherence\osb-coherence-override.xml
======================================================================================================================



<!DOCTYPE coherence SYSTEM "coherence.dtd">
<coherence>
    <cluster-config>
        <!--
            By specifying a well-known-address we disable the mutlicast listener.
            This ensures that the Coherence cluster for OSB will be isolated to this machine only.
        -->
        <unicast-listener>
            <well-known-addresses>
                <socket-address id="1">
                    <address system-property="OSB.coherence.wka1">xxx.xxx.oracle.com</address>
                    <port system-property="OSB.coherence.wka1.port">7890</port>
                </socket-address>
                <socket-address id="2">
                    <address system-property="OSB.coherence.wka2">xxx.xxx.oracle.com</address>
                    <port system-property="OSB.coherence.wka2.port">7898</port>
                </socket-address>
            </well-known-addresses>
            <address system-property="OSB.coherence.localhost">xxx.xxx.oracle.com</address>
            <port system-property="OSB.coherence.localport">7890</port>
        </unicast-listener>
        <multicast-listener>
            <time-to-live system-property="OSB.coherence.ttl">0</time-to-live>
        </multicast-listener>
    </cluster-config>
</coherence>

+++++++++++++

Where
 <socket-address id="1">
                    <address system-property="OSB.coherence.wka1">xxx.xxx.oracle.com</address>
                    <port system-property="OSB.coherence.wka1.port">7890</port>
                </socket-address>

Is for the stand alone Coherence server

<socket-address id="2">
                    <address system-property="OSB.coherence.wka2">xxx.xxx.oracle.com</address>
                    <port system-property="OSB.coherence.wka2.port">7898</port>
                </socket-address>

Is for the OSB Server

No need to change the file
\\soabde11\fmw11g\fmw1117\Middleware\user_projects\domains\soa_domain\config\osb\coherence\osb-coherence-cache-config.xml

Once it is done , open the setDomainEnv.sh file

EXTRA_JAVA_PROPERTIES="${EXTRA_JAVA_PROPERTIES} -Dsoa.archives.dir=${SOA_ORACLE_HOME}/soa -Dsoa.oracle.home=${SOA_ORACLE_HOME} -Dsoa.instance.home=${DOMAIN_HOME} -Dtangosol.coherence.distributed.localstorage=false -DOSB.coherence.localhost=xxx.xxx.oracle.com -DOSB.coherence.localport=7898 -Dtangosol.coherence.wka1=xxx.xxx.oracle.com -Dtangosol.coherence.wka2=xxx.xxx.oracle.com  -Dtangosol.coherence.wka1.port=7898 -Dtangosol.coherence.wka2.port=7890 -Dtangosol.coherence.log=jdk -Djavax.xml.soap.MessageFactory=oracle.j2ee.ws.saaj.soap.MessageFactoryImpl -Dweblogic.transaction.blocking.commit=true -Dweblogic.transaction.blocking.rollback=true -Djavax.net.ssl.trustStore=${WL_HOME}/server/lib/DemoTrust.jks"

The default entries are

#EXTRA_JAVA_PROPERTIES="${EXTRA_JAVA_PROPERTIES} -Dsoa.archives.dir=${SOA_ORACLE_HOME}/soa -Dsoa.oracle.home=${SOA_ORACLE_HOME} -Dsoa.instance.home=${DOMAIN_HOME} -Dtangosol.coherence.clusteraddress=227.7.7.9 -Dtangosol.coherence.clusterport=9778 -Dtangosol.coherence.log=jdk -Djavax.xml.soap.MessageFactory=oracle.j2ee.ws.saaj.soap.MessageFactoryImpl -Dweblogic.transaction.blocking.commit=true -Dweblogic.transaction.blocking.rollback=true -Djavax.net.ssl.trustStore=${WL_HOME}/server/lib/DemoTrust.jks"

basically you need to remove
-Dtangosol.coherence.clusteraddress=227.7.7.9 -Dtangosol.coherence.clusterport=9778
and replace this with
-Dtangosol.coherence.distributed.localstorage=false -DOSB.coherence.localhost=xxx.xxx.oracle.com -DOSB.coherence.localport=7898 -Dtangosol.coherence.wka1=xxx.xxx.oracle.com -Dtangosol.coherence.wka2=xxx.xxx.oracle.com  -Dtangosol.coherence.wka1.port=7898 -Dtangosol.coherence.wka2.port=7890


Create a shell script to start the Coherence server

+++++

#!/bin/sh

# Change below to appropriate location
JAVA_HOME="/home/oracle/jdk1.7.0_67"
WLS_HOME="/fmw11g/fmw1117/Middleware"
COHERENCE_HOME="${WLS_HOME}/coherence_3.7/"
OSB_ORACLE_HOME="${WLS_HOME}/Oracle_OSB1"
OSB_COHERENCE_CONFIG="${WLS_HOME}/user_projects/domains/soa_domain/config/osb/coherence"

NEW_SIZE=2048m
HEAP_SIZE=4096m

NODE_NAME="CacheServer"

# Change below to appropriate ip address and port
LOCAL_HOST="xxx.xxx.oracle.com"
LOCAL_PORT="9094"

JAVA_OPTS="-Xloggc:gc_${NODE_NAME}.log -server -XX:NewSize=${NEW_SIZE} -XX:MaxNewSize=${NEW_SIZE} -Xms${HEAP_SIZE} -Xmx${HEAP_SIZE} -XX:PermSize=128m -XX:MaxPermSize=128m -verbose:gc -XX:+PrintGCDateStamps -XX:+PrintGCDetails"

JMXPROPERTIES="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Dtangosol.coherence.management=all -Dtangosol.coherence.management.remote=true "

COHERENCE_OPTS="-Dtangosol.coherence.distributed.localstorage=true -Dtangosol.coherence.override=${OSB_COHERENCE_CONFIG}/osb-coherence-override.xml -Dtangosol.coherence.cacheconfig=${OSB_COHERENCE_CONFIG}/osb-coherence-cache-config.xml -Dtangosol.coherence.log.level=9 -Dtangosol.coherence.cluster=OSB-cluster -Dtangosol.coherence.localhost=${LOCAL_HOST} -Dtangosol.coherence.localport=${LOCAL_PORT}"

CLASSPATH="$COHERENCE_HOME/lib/coherence.jar:$OSB_ORACLE_HOME/lib/osb-coherence-client.jar"

$JAVA_HOME/bin/java -server -showversion $JAVA_OPTS $COHERENCE_OPTS $JMXPROPERTIES -cp "$CLASSPATH" com.tangosol.net.DefaultCacheServer $1

+++++

First start the coherence server using the script
c1.sh

and after this start the OSB Server.





Tags: Publish
April 03, 2017 at 02:22PM
Open in Evernote