Showing posts with label soa. Show all posts
Showing posts with label soa. Show all posts

Friday, June 5, 2015

URL to get SOA 11g or SOA 12c Status

If you need to check if SOA is UP and Running there is a URL that you can use from Load Balancers.

http://[host]:[port]/soa-infra/services/isSoaServerReady

It will return response code 503 (Service Unavailable) when SOA Server is not ready to accept requests and 200(OK) when SOA Platform is running and accepting requests.

For 11.1.1.6 and 11.1.1.7 with must apply patch 17571359.



Friday, December 19, 2014

Publish Event from Java to Oracle SOA 12c EDN

I needed to send EDN Events to a SOA 12c from Java and taking as example the Edwin's Biemond post Publish Event from Java with JMS I decided to update it to version 12c.

In 12c EDN is different, it were rewritten and it's based on Topics.

Now supports WLJMS as default, or you can use AQJMS, and we don't need to specify the Topic, it take it from the default configuration.

Make a new JDeveloper Java Project and create a Java class PublishEvent.


package com.vatrox.soa.edn.utils;

import java.util.Properties;

import javax.naming.Context;

import javax.xml.namespace.QName;

import oracle.fabric.blocks.event.BusinessEventConnection;
import oracle.fabric.blocks.event.BusinessEventConnectionFactory;

import oracle.integration.platform.blocks.event.BusinessEventBuilder;
import oracle.integration.platform.blocks.event.jms2.EdnJmsConnectionFactory;

import oracle.soa.common.util.XMLUtil;

import org.w3c.dom.Element;

public class PublishEvent {
    public static void main(String[] args) {
        // My SOA WebLogic variables
        Properties props = new Properties();
        props.put(Context.PROVIDER_URL, "t3://soaserver.vatrox.com:8001");
        props.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
        props.put(Context.SECURITY_PRINCIPAL, "weblogic");
        props.put(Context.SECURITY_CREDENTIALS, "welcome1");
        
        // the business Event
        String DemoEvent = "DemoEvent";
        String NameSpace = "http://xmlns.oracle.com/Vatrox_SOA_EDN/DemoEDN/demoEvent";
        String DemoEventBody =
            "<Evento>" + "<dato>DemoEvent</dato>" + "</Evento>";
        Element eventBody = null;
        try {
            eventBody = XMLUtil.parseDocumentFromXMLString(DemoEventBody.toString()).getDocumentElement();
        } catch (Exception e) {
            e.printStackTrace();
        }
        try {
            
            BusinessEventConnectionFactory factory = new EdnJmsConnectionFactory(props);
            BusinessEventConnection conn = factory.createBusinessEventConnection();

            // Create an event
            BusinessEventBuilder builder = BusinessEventBuilder.newInstance();
            builder.setEventName(new QName(NameSpace, DemoEvent));
            builder.setBody(eventBody);

            // publish
            conn.publishEvent(builder.createEvent(), 4);
            conn.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}


 

The jars that you must use in the project are:
$MDW_HOME/soa/soa/modules/oracle.soa.fabric_11.1.1/edn.jar
$MDW_HOME/soa/soa/modules/oracle.soa.fabric_11.1.1/fabric-runtime.jar
$MDW_HOME/soa/soa/modules/oracle.soa.mgmt_11.1.1/soa-infra-mgmt.jar
$MDW_HOME/oracle_common/modules/com.oracle.webservices.fabric-common-api_12.1.3.jar
$MDW_HOME/oracle_common/modules/oracle.xdk_12.1.3/xmlparserv2.jar
$MDW_HOME/wlserver/server/lib/weblogic.jar
$MDW_HOME/oracle_common/modules/oracle.jrf_12.1.3/jrf-api.jar
$MDW_HOME/soa/soa/modules/oracle.soa.fabric_11.1.1/tracking-core.jar
$MDW_HOME/soa/soa/modules/oracle.soa.adapter_11.1.1jca-binding-api.jar



 

Thursday, August 28, 2014

java.net.MalformedURLException: Unknown protocol:servicebus or Unknown protocol:bundle - Oracle SOA/BPM Suite 12c

If you are receiving one of this errors trying to use Oracle SOA/OSB/BPM Suite 12c in the same domain you must do this.


1) If you followed the note 12c: Error when Running both BPM and OSB in one Domain, 'java.net.MalformedURLException' (Doc ID 1903573.1) from Oracle Support from some time ago, they change it now.


a) You must take off the felix.service.urlhandlers=false from OSGI Framework start, if you added it before.



b) Now you must add com.bea.wli.sb.resources.url to the setStartupEnv.sh file at your domain/bin directory at every JAVA_OPTIONS where java.protocol.handler.pkgs appears.



setStartupEnv.sh

Change from (20 times maybe)


JAVA_OPTIONS=”${JAVA_OPTIONS} -Djava.protocol.handler.pkgs=oracle.mds.net.protocol|oracle.fabric.common.classloaderurl.handler|oracle.fabric.common.uddiurl.handler
|oracle.bpm.io.fs.protocol

to

JAVA_OPTIONS=”${JAVA_OPTIONS}  -Djava.protocol.handler.pkgs=oracle.mds.net.protocol|oracle.fabric.common.classloaderurl.handler|oracle.fabric.common.uddiurl.handler|oracle.bpm.io.fs.protocol|com.bea.wli.sb.resources.url”




Command in Linux

cp setStartupEnv.sh setStartupEnv.sh.bak


sed ‘s/|oracle.bpm.io.fs.protocol/|oracle.bpm.io.fs.protocol|com.bea.wli.sb.resources.url/g’ setStartupEnv.sh -i


Hope this helps.


Juan Pablo

Monday, February 4, 2013

File and FTP Operations Processes with Oracle SOA Suite 11g and OSB 11g Adapters

Oracle SOA Suite 11g File and FTP adapters supports operations that are not available with the wizards.

These operations are Copy, Move and Delete files between File and FTP servers.

It is explained at Oracle Fusion Middleware User's Guide for Technology Adapters

First I developed a composite with a bpel process that exposes this operations, and then an OSB 11g project that use the same adapters.

Some properties can't be assigned at runtime, that's why I created one jca for each operation.

The operations exposed are:

FileCopy -> SourceDirectory, SourceFile, TargetDirectory, TargetFile
FileMove -> SourceDirectory, SourceFile, TargetDirectory, TargetFile
FileDelete -> TargetDirectory, TargetFile
FileToFTPCopy -> SourceDirectory, SourceFile, TargetDirectory, TargetFile, jndiFtp
FileToFTPMove -> SourceDirectory, SourceFile, TargetDirectory, TargetFile, jndiFtp
FTPCopy -> SourceDirectory, SourceFile, TargetDirectory, TargetFile, jndiFtp
FTPMove -> SourceDirectory, SourceFile, TargetDirectory, TargetFile, jndiFtp
FTPDelete -> TargetDirectory, TargetFile, jndiFtp
FtpToFileCopy -> SourceDirectory, SourceFile, TargetDirectory, TargetFile, jndiFtp
FtpToFileMove -> SourceDirectory, SourceFile, TargetDirectory, TargetFile, jndiFtp

The jndiFtp parameter that you use must be added to the FtpAdapter Resource Adapter and redeploy it.
For example: you can use the standard eis/ftp/FtpAdapter or create a new one with the desired configuration.


If the FTP server does not support the RNFR/RNTO FTP commands, then you must set UseNativeRenameOperation to FALSE and define the property in composite.xml, as shown in the following example:

<reference name="FTPMove" ui:wsdlLocation="FTPMove.wsdl">
  <interface.wsdl interface="http://xmlns.oracle.com/pcbpel/adapter/ftp/SOAFtpIO/SOAFtpIO/FTPMove/#wsdl.interface(FTPMove_ptt)"/>
    <binding.jca config="FTPMove_ftp.jca">
      <property name="UseNativeRenameOperation" type="xs:string" many="false" override="may">false</property>
    </binding.jca>
</reference>

If you use this app in a Cluster installation, must change the jca source files to use HA Adapters.

The source code is here.

I hope that this helps.

JP