Tuesday, June 14, 2016

Oracle SOA BPEL Ant Script for composite svn checkout, weblogic build and deploy

Oracle SOA BPEL Ant Script for composite svn checkout,  weblogic build and deploy

1. Below command is used to checkout the source from svn
call "C:\Program Files\TortoiseSVN\bin\svn.exe"  checkout <SVN Path>  "C:\Oracle\SOA\" --non-interactive --no-auth-cache --username <svn user name> --password <svn password>

2. Below command will build composite jar file from the source code.
In below command, composite name is assume as "SOAComposite"

call C:\sw\apache-ant-1.9.6-bin\apache-ant-1.9.6\bin\ant -f C:\Oracle\Middleware\Oracle_Home\soa\bin\ant-sca-package.xml  -DcompositeDir=C:\Oracle\SOA\SOAComposite\SOA -DcompositeName=SOAComposite -Drevision=1.0  -Dsca.application.home=C:\Oracle\SOA\SOAComposite

3. Below command is used to deploy the jar in weblogic
/apache/ant/apache-ant-1.9.6/bin/ant -f /oracle/products/oracle_home/soa/bin/ant-sca-deploy.xml -v -DserverURL=http://<IP>:<Port> -DsarLocation=<Full Path of Composite Jar file>-Doverwrite=true  -Duser=<Weblogic User Name> -Dpassword=<Weblogic Password>  -DforceDefault=true  -Dpartition=default

You can have all three commands in a shell script or batch files.

Oracle SOA Adaptor Log Diagnostic

Below option provide some clue to diagnose the issue while using the adapters like righnow

1.] Go to your Enterprise Manager console;
2.] On the Target Navigation on the left side of the screen, locate SOA > your soa server;
3.] Right click on the SOA server;
4.] Go to Logs > Log Configuration;
5.] In the Log Configuration page, do a search on Oracle.SOA.adapter;
6.] Expand the first node and locate the rightnow adapter;
7.] In the Oracle Diagnostic Logging Level, select TRACE:32 (FINEST);
8.] Click Apply;
9.] Do a test in your composite to reproduce the issue; and
10.] Immediately upload the Diagnostic Log file of the SOA server located at DOMAIN_NAME/SERVERS/SERVER_NAME/LOGS/*.log; 

Wednesday, March 2, 2016

Oracle SOA BPEL Schema changes not reflecting

Ti include a new schema we should import it in wsdl and include it in BPEL. If we do some modification in schema sometime we may not see the changes while assign or transformation. In that scenario just close all the open files in JDeveloper and reopen it to resolve this JDeveloper issue.

Exception is thrown because the to-spec at line 261 is evaluated to be empty

Problem: Exception is thrown because the to-spec at line 261 is evaluated to be empty


In Oracle SOA BPEL Assign statement when you come across this error

Open assign activity, right click on copy operation select "ignore missing from data" and  "insert missing to data"

Root cause: Target schema is having no element with the name may be because it's minOccurs="0"
                                             


Friday, February 19, 2016

Oracle SOA BPEL Pass Credential to external service

To pass the credential to the service we can use oracle.webservices.auth.username  property in reference of the composite.xml

Below is the example to connect to planisware service.


<reference name="Planisware" ui:wsdlLocation="Planisware_WSDL_New.wsdl">
    <interface.wsdl interface="http://www.planisware.com/SOAP/SampleDoc#wsdl.interface"/>
    <binding.ws port="http://www.planisware.com/SOAP/SampleDoc#wsdl.endpoint)"
                location="Planisware_WSDL_New.wsdl" soapVersion="1.1">
      <property name="weblogic.wsee.wsat.transaction.flowOption"
                type="xs:string" many="false">NEVER</property>
            <property name="oracle.webservices.auth.username" type="xs:string"
                many="false" override="may">UserName</property>
      <property name="oracle.webservices.auth.password" type="xs:string"
                many="false" override="may">Password</property>                
    </binding.ws>
  </reference>

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.