oraclemanaged’file’transfer’soaintegration’€™file’transfer’soaintegration’ ’ ’...

21
Oracle Managed File Transfer SOA Integration Table of Contents Prerequisites ................................................................................................................................................ 1 Introduction ................................................................................................................................................. 2 HighLevel Steps .......................................................................................................................................... 2 Create and Deploy a SOA Project in JDeveloper for MFT to Invoke ........................................................ 2 Create and Deploy a SOA Target in MFT to Invoke the SOA Composite ................................................. 3 Modify BPEL Process to Parse Inbound Payload Types from MFT........................................................... 3 Steps in Detail .............................................................................................................................................. 3 Create and Deploy a SOA Project in JDeveloper for MFT to Invoke ........................................................ 3 Goals .................................................................................................................................................... 3 JDeveloper: Create new Application and Composite Project “MFT Orders” ....................................... 4 JDeveloper 12c: Create Composite Service using the MFT Binding ..................................................... 5 JDeveloper 11g: Create Composite Service using the MFT Abstract WSDL ......................................... 6 Build the BPEL Process ......................................................................................................................... 9 Create and Deploy a SOA Target in MFT to Invoke the SOA Composite ............................................... 11 MFT: Send the Order file to a SOA Composite .................................................................................. 11 Target: Create a new Target "OrdersSOATarget" .............................................................................. 12 Test Composite Invocation with Small File Inline Delivery ................................................................ 15 Test Composite Invocation with a Large File for PassbyReference Delivery ................................... 19 Observations and Advanced Extra Credit .......................................................................................... 20 Prerequisites An understanding and working knowledge of Oracle SOA 11g or 12c MFT and SOA servers are both installed, configured and running o This document assumes the following username/password. Change as needed o Username/password of “weblogic/master1” Identify your SOA and MFT hostnames and ports for later use in these documents

Upload: phungkhue

Post on 21-Apr-2018

215 views

Category:

Documents


2 download

TRANSCRIPT

 

Oracle  Managed  File  Transfer  SOA  Integration      

Table  of  Contents    

Prerequisites  ................................................................................................................................................  1  

Introduction  .................................................................................................................................................  2  

High-­‐Level  Steps  ..........................................................................................................................................  2  

Create  and  Deploy  a  SOA  Project  in  JDeveloper  for  MFT  to  Invoke  ........................................................  2  

Create  and  Deploy  a  SOA  Target  in  MFT  to  Invoke  the  SOA  Composite  .................................................  3  

Modify  BPEL  Process  to  Parse  Inbound  Payload  Types  from  MFT  ...........................................................  3  

Steps  in  Detail  ..............................................................................................................................................  3  

Create  and  Deploy  a  SOA  Project  in  JDeveloper  for  MFT  to  Invoke  ........................................................  3  

Goals  ....................................................................................................................................................  3  JDeveloper:  Create  new  Application  and  Composite  Project  “MFT  Orders”  .......................................  4  JDeveloper  12c:  Create  Composite  Service  using  the  MFT  Binding  .....................................................  5  JDeveloper  11g:  Create  Composite  Service  using  the  MFT  Abstract  WSDL  .........................................  6  Build  the  BPEL  Process  .........................................................................................................................  9  

Create  and  Deploy  a  SOA  Target  in  MFT  to  Invoke  the  SOA  Composite  ...............................................  11  

MFT:  Send  the  Order  file  to  a  SOA  Composite  ..................................................................................  11  Target:  Create  a  new  Target  "OrdersSOATarget"  ..............................................................................  12  Test  Composite  Invocation  with  Small  File  Inline  Delivery  ................................................................  15  Test  Composite  Invocation  with  a  Large  File  for  Pass-­‐by-­‐Reference  Delivery  ...................................  19  Observations  and  Advanced  Extra  Credit  ..........................................................................................  20  

 

Prerequisites  

• An  understanding  and  working  knowledge  of  Oracle  SOA  11g  or  12c  • MFT  and  SOA  servers  are  both  installed,  configured  and  running  

o This  document  assumes  the  following  username/password.  Change  as  needed  o Username/password  of  “weblogic/master1”  

• Identify  your  SOA  and  MFT  hostnames  and  ports  for  later  use  in  these  documents  

 

Oracle MFT SOA Integrations Page 2 of 21

   

o EXAMPLE:  MFT  -­‐  localhost:7001;  SOA  -­‐  localhost:7101  • You  have  fully  completed  the  exercise  in  the  MFT  Getting  Started  document  

o Orders2ProcurementTransfer  is  deployed  and  tested  • JDeveloper  is  installed  and  open  with  an  Application  Server  Connection  defined  

o This  requires  a  SOA  sever  hostname,  port,  domain  name,  user  and  password  

Introduction  This  chapter  gives  instructions  on  how  to  use  Oracle  Managed  File  Transfer  to  process  documents  that  can  be  passed  to  a  SOA  11g  or  12c  composite.  The  completed  MFT  flow  looks  like  the  following.  

 

High-­‐Level  Steps  

Create  and  Deploy  a  SOA  Project  in  JDeveloper  for  MFT  to  Invoke    1. In  JDeveloper,  create  a  connection  to  your  SOA  server  

2. Create  a  new  Composite  and  BPEL  Process  with  Define  Service  Later  

3. In  the  Composite  editor,  create  an  MFT  service  with  SOA  Component  MFT  Binding  

4. Create  a  Receive  activity  and  wire  it  to  the  MFT  service  

 

Oracle MFT SOA Integrations Page 3 of 21

   

5. Create  a  Reply  activity  and  wire  it  to  the  MFT  service  

6. Create  an  Assign  activity  to  send  a  response  to  the  MFT  service  response  

7. Save,  deploy  and  test.  

Create  and  Deploy  a  SOA  Target  in  MFT  to  Invoke  the  SOA  Composite  1. In  MFT  Designer,  create  a  new  SOA  Target  artifact  

2. Add  it  to  the  Orders2ProcurementTransfer  you  previously  created  

3. Save,  Deploy  and  Test  

4. Go  to  SOA  EM  Console  and  view  the  composite  instance  that  was  created  

Modify  BPEL  Process  to  Parse  Inbound  Payload  Types  from  MFT  1. In  JDeveloper,  edit  the  BPEL  process  created  previously  

2. Create  a  Composite  Reference  pointing  to  a  Composite  Service.  

3. Create  an  If  activity  to  process  an  inline  file.  

4. Assign  the  MFT  Inline  Payload  to  BPEL  Variable  

5. Save,  deploy  and  test  

Steps  in  Detail  

Create  and  Deploy  a  SOA  Project  in  JDeveloper  for  MFT  to  Invoke  

Goals  

In  this  lab,  you  will  learn  how  to  build  an  MFT  Service  in  a  SOA  Composite  and  invoke  it  from  MFT.  You  will  see  how  MFT  dynamically  decides  based  on  file  size  whether  to  pass  the  content  inline  or  by  reference.  Make  sure  your  SOA  server  is  in  Development  mode  so  you  can  view  the  MFT  headers  passed  to  SOA  composite.  If  you  are  using  SOA  and  JDeveloper  11g,  there  are  instructions  on  how  to  build  your  composite  from  the  provided  MFTSOAService.wsdl.  

The  completed  12c  MFT-­‐Orders  composite  and  BPEL  Process  looks  like  the  following.  

 

Oracle MFT SOA Integrations Page 4 of 21

   

       

JDeveloper:  Create  new  Application  and  Composite  Project  “MFT  Orders”  • In  JDeveloper  Resources  Window(Window-­‐>Resources),  verify  your  servers  are  started  

and  a  valid  connection  exists  to  the  SOA  Application  server.  

     • Create  a  new  SOA  Project  Composite  and  BPEL  2.0  Process  with  Define  Service  Later  

o Project  Type:  SOA  Project  

o Project  Name=MFT  Orders  

o Start  from:  Composite  With  BPEL  Process  

o BPEL  2.0  Specification  

o Template:  Define  Service  Later  

o BPEL  Process  Name:  MFTBPELProcessor  

 

Oracle MFT SOA Integrations Page 5 of 21

   

 

JDeveloper  12c:  Create  Composite  Service  using  the  MFT  Binding  • In  Composite  editor,  create  an  MFT  Service  using  the  SOA  Component  MFT  Binding  

o Service  Name:  MFTOrders  

     

 

 

Oracle MFT SOA Integrations Page 6 of 21

   

• Wire  the  Service  to  the  BPEL  Process  and  Save  All  

   

JDeveloper  11g:  Create  Composite  Service  using  the  MFT  Abstract  WSDL  JDeveloper  11g  does  not  have  the  MFT  binding  so  you  will  use  a  regular  Web  Service  binding  with  the  MFTSOAService.wsdl.  

• Copy  the  following  WSDL  from  your  MFT  installation  home  into  your  local  file  system  

o $MW_HOME/mft/integration/wsdl/MFTSOAService.wsdl  

• In  Composite  editor,  create  an  MFT  Service  using  the  Web  Service  Binding  with  the  above  WSDL  

o Service  Name:  MFTOrders  

 • Select  the  MFTSOAService.wsdl  

 

 

Oracle MFT SOA Integrations Page 7 of 21

   

           

• Click  OK  

 

   

• Review,  Click  “copy  wsdl  and  dependent  artifacts  into  the  project”  and  Click  OK  

 

Oracle MFT SOA Integrations Page 8 of 21

   

 • Wire  the  Service  to  the  BPEL  Process,  Click  OK  and  Save  All  

 

 

Oracle MFT SOA Integrations Page 9 of 21

   

Build  the  BPEL  Process  • Open    BPEL  editor,  create  Receive  activity,  wire  it  to  the  MFTOrders    and  set  input  

variable  

o Name:  ReceiveMFT  

o Create  Instance:  Checked  

o Variable:  ReceiveMFT_submit_InputVariable  

 • Create  a  Reply  activity,  wire  it  to  the  MFTOrders  and  create  output  variable  

o Name:  ReplyMFT  

o Variable:  ReplyMFT_submit_OutputVariable  

 • Create  an  Assign  Activity  Copy  Rule  to  send  the  PayloadType  as  a  response  

 

Oracle MFT SOA Integrations Page 10 of 21

 

o $ReceiveMFT_submit_InputVariable.input/@PayloadType  

o Output:  $ReplyMFT_submit_OutputVariable-­‐>payload  

 • Save,  deploy  and  test.  

 Verify  Deployment  

 

Oracle MFT SOA Integrations Page 11 of 21

 

   

Create  and  Deploy  a  SOA  Target  in  MFT  to  Invoke  the  SOA  Composite    

MFT:  Send  the  Order  file  to  a  SOA  Composite  • Make  sure  your  SOA  server  is  in  development  mode  so  you  can  see  the  audit  trail  

• A  new  MFT  Target  will  invoke  the  MFTOrders  composite  you  previously  deployed.  

• Get  endpoint  URL  of  the  deployed  composite  MFTOrders  from  the  SOA  EM  Test  page  

   

 

Oracle MFT SOA Integrations Page 12 of 21

 

   

Target:  Create  a  new  Target  "OrdersSOATarget"  

• Name:  OrderSOATarget  • Type:  SOA  • URL:  http://localhost7101/soa-­‐infra/services/default/MFT_Orders/MFTOrders  • Keep  defaults  on  all  other  values  • Click  Create  

 

• Save  • Expand  the  Delivery  Preferences  and  set  Delivery  Method  to    

 

Oracle MFT SOA Integrations Page 13 of 21

 

 

• Add  the  Decompress  and  PGP  Decryption  Pre-­‐Processing  Actions  like  you  did  for  the  original  “Procurement  File  Target”.    

 

• To  send  the  Inline  payload  as  XML,  Right  Click  open  the  OrdersSOATarget  and  change  Message  Type  to  XML.  

 

 

Oracle MFT SOA Integrations Page 14 of 21

 

 

• Save  and  Close  the  Source  and  go  back  to  the  Transfer  Tab  • Save  and  Deploy  the  Transfer  

                         

 

 

Oracle MFT SOA Integrations Page 15 of 21

 

Test  Composite  Invocation  with  Small  File  Inline  Delivery  

• Repeat  the  test  steps  you  did  before  by  putting  the  OrderSample.xml.pgp.zip  to  the  “/partner1”  folder  on  the  MFT  Embedded  FTP  server.  This  will  send  the  file  to  SOA  inline  because  the  file  size  is  less  than  the  configured  Max  Inline  Size  on  the  Transfer.    

• Go  to  MFT  Monitoring  and  find  your  transfer  in  the  File  Finder  pane  o Enter  File  Name:  “OrderSample”  

 

• Click  the  OrdersFTPSource  link  to  view  the  end  to  end  flow  report    • Notice  the  File  was  sent  to  both  targets  OrdersSOATarget  and  OrdersFileTarget  

 

• Go  to  the  SOA  EM  Console  and  view  the  composite  instance  details  

 

Oracle MFT SOA Integrations Page 16 of 21

 

 

 

   

• Click  on  the  BPEL  Process  to  see  the  audit  trail  

 

• Click  View  Payload  to  see  the  PayloadType  and  inline  XML  payload    

 

Oracle MFT SOA Integrations Page 17 of 21

 

 

 

     

• Scroll  down  to  see  the  headers  

 

Oracle MFT SOA Integrations Page 18 of 21

 

 

• Go  back  to  the  Flow  Trace  View  and  Click  the  Managed  File  Transfer  Link  

         

• This  takes  you  directly  back  to  the  MFT  Console  flow  report  for  full  end  to  end  visibility  of  files  transfers.  

 

Click  Resubmit  then  Refresh  both  the  MFT  flow  report  and  the  SOA  EM  Flow  report.    

 

 

Oracle MFT SOA Integrations Page 19 of 21

 

 

 

 

Notice  MFT  now  shows  a  resubmitted  instance  link  and  SOA  EM  shows  a  2nd  instance  of  MFTOrders  in  the  same  composite  flow.  This  takes  advantage  of  a  new  SOA  EM  12c  composite  flowid.  The  behavior  in  the  11g  SOA  EM  is  slightly  different  due  to  the  lack  of  a  the  flow  id.  

Test  Composite  Invocation  with  a  Large  File  for  Pass-­‐by-­‐Reference  Delivery  

• Repeat  the  previous  testing  step  with  the  larger  file  OrderSampleLarge.xmp.pgp.zip  • See  the  new  instance  in  the  MFT  Monitoring  console  “Active  Deliveries”    region.  

 

• Go  back  and  view  the  BPEL  payload  BPEL  and  observe  the  different  PayloadType  and  payload  as  an  FTP  Reference  

 

Oracle MFT SOA Integrations Page 20 of 21

 

 

Observations  and  Advanced  Extra  Credit  

Using  this  metadata,  you  can  modify  the  composite  to  process  both  inline  and  the  reference  to  send  to  an  outbound  composite  reference.  To  process  the  reference  you  would  need  to  configure  an  FTP  adapter  to  do  a  synch  read  operation  and  send  it  to  the  outbound  service.  Splitting  or  debatching  a  very  large  file  into  smaller  files  would  be  an  excellent  use  case  for  this  technique.  The  MFT  header  data  can  also  be  used  to  use  business  rules  or  manual  task  approvals  based  on  the  file  size,  the  user  who  uploaded  it,  the  Source  name  which  often  corresponds  to  a  partner.  

MFT  Supports  the  following  Payload  Types  for  both  inbound  Sources  and  outbound  Targets.  

• FtpRefFile  • FtpRefDir  • FileRefFile  • FileRefDir  • InlineBinary  • InlineXML  

Below  are  screenshot  showing  an  example  of  how  you  could  build  a  single  multi-­‐purpose  MFT  processor  to  handle  the  different  payloads  types.  This  one  takes  the  inbound  inline  content  and  sends  it  to  an  external  OrderProcessing  service.    

 

 

Oracle MFT SOA Integrations Page 21 of 21

 

 

 

 

Here  are  some  hints  and  tricks  if  you  take  on  this  exercise.  

1. Create  a  global  string  variable  and  copy  the  PayloadType  to  it  then  do  an  if  on  that  variable  a. Here  is  the  list  of  condition  expressions  for  the  if  else  logic  

• FtpRefFile            à          xp20:compare($PayloadType,'FtpRefFile')  =  0  • FtpRefDir              à          xp20:compare($PayloadType,'FtpRefDir')  =  0  • FileRefFile            à        xp20:compare($PayloadType,'FileRefFile')  =  0  • FileRefDir              à        xp20:compare($PayloadType,'FileRefDir')  =  0  • InlineBinary    à        xp20:compare($PayloadType,'InlineBinary')  =  0  • InlineXML  is  the  else  fall  through  path  which  requires  no  expression.  

2. Create  an  Assign  Activity  to  map  the  Inline  payload  to  the  outbound  ProcessOrder  input  3. INPUT  $ReceiveMFT_submit_InputVariable.input/  ns1:InlinePayload/ns3:Order  

a. Note  that  you  cannot  use  the  UI  to  create  this  expression  because  the  MFT  WSDL  does  not  know  about  orders.  The  part  in  bold  above  must  be  manually  added.  

4. If  you  want  to  try  a  Sync  Read  of  the  passed  in  file  reference  to  operate  on  the  file,  then  it  would  be  easier  if  you  change  the  MFT  Target  to  send  a  File  reference  instead  of  an  FTP  reference.  FTP  is  useful  if  MFT  and  SOA  are  not  sharing  the  same  file  system.  

a. You  will  need  to  do  some  string  manipulation  of  the  file://  or  ftp://  reference  to  build  the  correct  filename  and  path  parameters  to  be  sent  to  the  adapter.  

That  completes  this  exercise.    One  more  interesting  exercise  would  be  to  bring  down  the  SOA  server  and  run  the  transfer  to  observe  how  exceptions  are  exposed  in  this  fan-­‐out  project.