Wednesday, April 27, 2016

SOAP with Attachments in OSB


                     SOAP with Attachments in OSB


This post is aimed for inline attachments

There are different ways to read the attachment and send back as SOAP attachment.


Here are the steps 

Step1:
How to construct response for SOAP with attachments? Is there any change required in WSDL?

Here is WSDL sample for Response 

                     <wsdl:output name="generateDocumentResponse">                        


                           <mime:multipartRelated>


                           <mime:part>


                           <soap:body parts="generateDocumentResponse pdfAttachment" use="literal" namespace="http://eai.officedepot.com/model/GenerateDocument"/>


                           </mime:part>


                           <mime:part>


                           <mime:content part="pdfAttachment" type="application/pdf"/>


                           </mime:part>


                           </mime:multipartRelated>


                     </wsdl:output>

Do you need complete WSDL? Comment / email me and respond back with sample code


Step2: Read the PDF Document.

There are multiple ways to read the document.
  1. You can use the File Adapter to read the document
  2. Use Java code to read attachment. Here is the example for Java code.
public static byte[] readFileInputStream(String filename) throws IOException {


                     // fileName = C:/Temp/TestFiles/Poll/testAttachment.pdf


                     byte [] buffer =null;


                     File a_file = new File(filename);


                     try


                     {


                           FileInputStream fis = new FileInputStream(filename);


                           int length = (int)a_file.length();


                           buffer = new byte [length];


                           fis.read(buffer);                  


                           fis.close();


                     }


                     catch(IOException e)


                     {


                           System.out.println("Error in reading the File...");


                     }


                      


                     return buffer;


              }


      }


Use the Java callout in OSB to read attachment through Java.









 Step 3: Use insert activity to attach document inline



Step4:  Use reply activity to respond back.
Still confused? Enter comment here or send me an email with your requirement

Tuesday, September 15, 2015

Configuration Plan with Ant


1. Through JDEV


Generate Configuration Plan


* From Projects Explorer, right click composite.xml file.
* Select Generate Config Plan.
* On Composite Configuration Plan Generator dialog, enter
- Name: service_dev_cfgplan.xml
- Click OK.

Deploy New Configuration Plan using JDev


* Right click Service.
* Select Deploy -> service...
* Select Deploy to Application Server.
- Click Next.
* On Deploy Configuration dialog, enter
- New Revision ID: 1.1
- Expand SOA Configuration Plan and Select
service_dev_cfgplan.xml
- Click Next buttons until Finish button is active.
- Click Finish.

2. ANT Scripts:

Set Path
set JDEV_HOME=C:\Oracle\Middleware\jdeveloper
set PATH=%JDEV_HOME%\ant\bin;%PATH%
COMPILE: ant -f ant-sca-package.xml(OSB)
DEPLOY: ant -f ant-sca-deploy.xml(OSB)
  1. set ORACLE_HOME=C:\oracle\MiddlewareJdev11gR1PS3  
  2. set ANT_HOME=%ORACLE_HOME%\jdeveloper\ant  
  3. set PATH=%ANT_HOME%\bin;%PATH%  
  4. set JAVA_HOME=%ORACLE_HOME%\jdk1.6.0_23  
  5.   
  6. set CURRENT_FOLDER=%CD%  
  7.   
  8. ant -f build.xml deployAll 

Deploy Configuration Plan with EM Console

* Login to EM. * Click Farm_soa_domain -> SOA -> soa-infra (soa_server1) -> default * On right side panel, - Click Deployment drop down box. - Select Deploy to this partition. * In Select Archive page, - Select Archive is on the machine where this web browser is running. - Browse to C:\XXX\Service1\deploy\sca_service_rev1.1.jar. - Select Configuration plan is on the machine where this web browser is running. - Browse to C:\XXX\Service1\service_dev_cfgplan.xml. * In Confirmation page, - Select Deploy as default revision. - Click Deploy.
https://docs.oracle.com/cd/E29597_01/dev.1111/e10224/sca_lifecycle.htm

Monday, April 27, 2015

tablespace ORA-01654 issue with Oracle SOA BPM

Recently encountered an issue with Tablespace.
Error :
oracle.fabric.common.FabricDeploymentException: oracle.mds.transfer.TransferException:

ORA-01654: unable to extend index DEV_MDS.MDS_ATTRIBUTES_U2 by 1024 in tablespace DEV_MDS

I was unable to deploy because of the Tablespace issue. Purged all the older instances in EM as well as MDS schema unsused files / versions/ projects. I had executed all the techniques provided by Oracle documentation to purge. Finally - increased the tablespace.

SQL command:
Connect SQL with Admin user and execute the below command

alter tablespace <<MDS Schema name>> add datafile 'datafile_name' size 500m
autoextend on;
 

For example,my MDS scema is "DEV_MDS"

  alter tablespace DEV_MDS add datafile 'datafile_name' size 500m
  autoextend on;


So Friends !! .. read the Oracle documentation first. There are other techniques to clear off the tablespace issue.