CA 2E / CA Plex Conference - …plex2e.com/.../Mark_Schroder-2E_Modernization_Workshop.pdfModern...

22
IBMi: Devi5.cmfirsttech.com User: CA2EUSER Password: CAUSER15 Call mlslib/str2e87 Models CMINMDLT01 – CMINMDLT35 https://www.dropbox.com/s/lp64afs526hqdsg/2EModernizationWorkshop.docx?dl=0 2E Modernization Workshop

Transcript of CA 2E / CA Plex Conference - …plex2e.com/.../Mark_Schroder-2E_Modernization_Workshop.pdfModern...

Page 1: CA 2E / CA Plex Conference - …plex2e.com/.../Mark_Schroder-2E_Modernization_Workshop.pdfModern Integrations with Web Services Page 10 i. Call#a#retrieve#object#toreturnall#the#fields#for#personexcept#for#the#audit#

 

 

 

 

     

IBMi: Devi5.cmfirsttech.com

User: CA2EUSER

Password: CAUSER15 Call mlslib/str2e87 Models CMINMDLT01 – CMINMDLT35 https://www.dropbox.com/s/lp64afs526hqdsg/2EModernizationWorkshop.docx?dl=0

 

2E  Modernization  Workshop  

 

Page 2: CA 2E / CA Plex Conference - …plex2e.com/.../Mark_Schroder-2E_Modernization_Workshop.pdfModern Integrations with Web Services Page 10 i. Call#a#retrieve#object#toreturnall#the#fields#for#personexcept#for#the#audit#

Database Modernization with SQL

Page 2

Database  Modernization  with  SQL  A. Set  up  the  Model  Values  

1. YCHGMDLVAL  =  CMINSMDL2  a. YCHGMDLVAL  MDLVAL(YSQLLIB)  VALUE(CMINSMDL2)  

   

   

2. YDBFGEN  =  *DDL  a. YCHGMDLVAL  MDLVAL(YDBFGEN)  VALUE(*DDL)              

3. YSQLLEN  =  25  a. YCHGMDLVAL  MDLVAL(YSQLLEN)  VALUE(25)          

4. YSQLVNM  =  *LNG  (Use the long names of the CA 2E objects in the model along with the DDS or implementation names.)  

a. YCHGMDLVAL  MDLVAL(YSQLVNM)  VALUE(*LNG)      

5. YCHGMDLVAL  =  *NO  

Page 3: CA 2E / CA Plex Conference - …plex2e.com/.../Mark_Schroder-2E_Modernization_Workshop.pdfModern Integrations with Web Services Page 10 i. Call#a#retrieve#object#toreturnall#the#fields#for#personexcept#for#the#audit#

Database Modernization with SQL

Page 3

a. YCHGMDLVAL  MDLVAL(YSQLCOL)  VALUE(*NO)Compile  the  file    

6. Look  at  the  DDS  for  file  “DDS  File  to  SQL”  file  to  verify  that  the  code  is  DDS  code.    

 7. Enter  a  G  on  the  Physical  File  for  “DDS  File  to  SQL”    8. Look  at  the  code  again.    This  time,  the  generated  code  for  the  physical  file  should  be  similar  

to  below  and  written  in  SQL/DDL  

 

Page 4: CA 2E / CA Plex Conference - …plex2e.com/.../Mark_Schroder-2E_Modernization_Workshop.pdfModern Integrations with Web Services Page 10 i. Call#a#retrieve#object#toreturnall#the#fields#for#personexcept#for#the#audit#

Database Modernization with SQL

Page 4

 

   

9. To  generate  the  Logical  files:      a.  Z  into  the  Update  Index.      b. Set  the  Data  access  method  to  T  for  Table.    This  will  suppress  creating  a  View.        

 

Page 5: CA 2E / CA Plex Conference - …plex2e.com/.../Mark_Schroder-2E_Modernization_Workshop.pdfModern Integrations with Web Services Page 10 i. Call#a#retrieve#object#toreturnall#the#fields#for#personexcept#for#the#audit#

Database Modernization with SQL

Page 5

 c. Once  the  Data  access  method  is  set,  generate  the  source  for  the  logical.      d. View  the  source  to  verify  it  has  been  generated  as  SQL/DDL  e. Report  steps  a,  b,  c  and  d  for  all  logical  files  for  this  file.    f. Go  to  the  Generate/Create  screen  and  finish  the  create  step.  You  are  now  creating  

type  YSQL.        

   

g. Run  the  program  without  generating  or  compiling  it.      

   

h. You  should  end  up  with  the  program  functioning  as  it  did  before.        

Page 6: CA 2E / CA Plex Conference - …plex2e.com/.../Mark_Schroder-2E_Modernization_Workshop.pdfModern Integrations with Web Services Page 10 i. Call#a#retrieve#object#toreturnall#the#fields#for#personexcept#for#the#audit#

Page 6

     

 

 

   

Page 7: CA 2E / CA Plex Conference - …plex2e.com/.../Mark_Schroder-2E_Modernization_Workshop.pdfModern Integrations with Web Services Page 10 i. Call#a#retrieve#object#toreturnall#the#fields#for#personexcept#for#the#audit#

Quick Modernization with Web Option

Page 7

Quick  Modernization  with  Web  Option  A. Add  the  Screen  ID    

 

   

a. Select  the  header/footer  that  contains  the  Screen  ID.    

B. Verify  that  the  Screen  ID  has  been  added.        

   

C. Gen  and  create  your  function.      D. Generate  the  HTML  

 

Page 8: CA 2E / CA Plex Conference - …plex2e.com/.../Mark_Schroder-2E_Modernization_Workshop.pdfModern Integrations with Web Services Page 10 i. Call#a#retrieve#object#toreturnall#the#fields#for#personexcept#for#the#audit#

Page 8

   

E. Run  the  web  application.    

 a. http://devi5.cmfirsttech.com:4630/web2e  b. Call  mlslib/inswo  c. Locate  your  screen.  

   

Page 9: CA 2E / CA Plex Conference - …plex2e.com/.../Mark_Schroder-2E_Modernization_Workshop.pdfModern Integrations with Web Services Page 10 i. Call#a#retrieve#object#toreturnall#the#fields#for#personexcept#for#the#audit#

Modern Integrations with Web Services

Page 9

Modern  Integrations  with  Web  Services  

A. Create  a  Web  Service  to  bring  back  a  record.    1. Create  three  basic  functions.    

a. SRV  Get  Person  (USERID)  PGM  b. SRV  Get  Person  (USERID)    MOD  c. SRV  Get  Person  (USERID)    SPS  d. SRV  Get  Person(USERID)  WS  –  Optional  based  on  method  of  WS  Deployment.  

 2. Set  up  the  PGM.    

 a. Set  the  HLL  to  RPG.    We  could  use  another  language  but  in  this  demo  RPG  will  be  

used.      

   

b. The  parameters.    i. Input  –  Person  ID  ii. Output  –  All  fields  except  the  audit  stamp  fields.  –  Create  an  array  with  

these  values.      

   

c. Set  up  the  business  logic.      

Page 10: CA 2E / CA Plex Conference - …plex2e.com/.../Mark_Schroder-2E_Modernization_Workshop.pdfModern Integrations with Web Services Page 10 i. Call#a#retrieve#object#toreturnall#the#fields#for#personexcept#for#the#audit#

Modern Integrations with Web Services

Page 10

i. Call  a  retrieve  object  to  return  all  the  fields  for  person  except  for  the  audit  stamp  fields.      

ii. Be  sure  to  put  in  an  exit  program.        

     3. Configure  the  MOD  program  

 

   

a. Set  the  HLL  to  RP4  b. Set  the  Object  Type  to  MOD  

i. To  do  this,  enter  a  T  at  ?  and  the  Object  Type  will  change  to  a  module.    c. Check  the  Compile  Overrides  

i. The    Compiler  Overrides  for  the  PGMINFO  parameter  to    ii. PGMINFO(*PCML  *MODULE)  

d. Set  the  Parameters    

   

i.  Input  parameters  –  If  you  use  an  access  path  or  array,  all  parameters  must  be  used.    

ii. Output  parameters  –  Create  an  array  with  the  fields  you  will  return.      

Page 11: CA 2E / CA Plex Conference - …plex2e.com/.../Mark_Schroder-2E_Modernization_Workshop.pdfModern Integrations with Web Services Page 10 i. Call#a#retrieve#object#toreturnall#the#fields#for#personexcept#for#the#audit#

Modern Integrations with Web Services

Page 11

e. Add  code  to  the  service  program    

i. Call  the  program.      ii. Add  an  exit  program  to  return  the  *return  code.    

 4. Configure  the  SPS  program  

a. Add  the  module  just  created  to  this  service  program.      

Page 12: CA 2E / CA Plex Conference - …plex2e.com/.../Mark_Schroder-2E_Modernization_Workshop.pdfModern Integrations with Web Services Page 10 i. Call#a#retrieve#object#toreturnall#the#fields#for#personexcept#for#the#audit#

Modern Integrations with Web Services

Page 12

b. Press  F6  to  add  the  module  and  then  select  the  module  from  the  existing  list  of  modules.      

5. Install  the  Web  Service  using  the  IBMi  Web  Services  Manager  a. Open  up  the  Web  Services  manager  

i.  http://devi5.cmfirsttech.com:2001/HTTPAdmin  ii. Select  Application  Services  

b. Click  on  the  Deploy  button.  c. Click  Next  until  you  are  at  the  Deploy  Web  services  screen  that  asks  for  the  program  

and  library.    

Page 13: CA 2E / CA Plex Conference - …plex2e.com/.../Mark_Schroder-2E_Modernization_Workshop.pdfModern Integrations with Web Services Page 10 i. Call#a#retrieve#object#toreturnall#the#fields#for#personexcept#for#the#audit#

Modern Integrations with Web Services

Page 13

d. Enter  the  library:  CMINSGEN2  e. Enter  the  Service  program  name:    (This  is  the  SPS  you  created)    f. Click  Next.    g. Enter  the  name  and  description  for  the  web  service.  

i. The  Service  name  cannot  have  blanks  between  words.    ii.  Service  description  should  point  back  to  the  service  program  name  you  

created.    

h. Click  Next  

Page 14: CA 2E / CA Plex Conference - …plex2e.com/.../Mark_Schroder-2E_Modernization_Workshop.pdfModern Integrations with Web Services Page 10 i. Call#a#retrieve#object#toreturnall#the#fields#for#personexcept#for#the#audit#

Modern Integrations with Web Services

Page 14

i. Enter  the  type  of  parms  for  the  Service.      

j. Click  next  until  the  Service  is  complete  and  you  are  back  an  the  manage  Services  screen.      

 

 

Page 15: CA 2E / CA Plex Conference - …plex2e.com/.../Mark_Schroder-2E_Modernization_Workshop.pdfModern Integrations with Web Services Page 10 i. Call#a#retrieve#object#toreturnall#the#fields#for#personexcept#for#the#audit#

Modern Integrations with Web Services

Page 15

   

6. Test  the  web  service  with  SOAPUI.    a. Create  a  test  project  

Page 16: CA 2E / CA Plex Conference - …plex2e.com/.../Mark_Schroder-2E_Modernization_Workshop.pdfModern Integrations with Web Services Page 10 i. Call#a#retrieve#object#toreturnall#the#fields#for#personexcept#for#the#audit#

Modern Integrations with Web Services

Page 16

   

b. Enter  the  Project  Name  and  the  WSDL  URL.      

Page 17: CA 2E / CA Plex Conference - …plex2e.com/.../Mark_Schroder-2E_Modernization_Workshop.pdfModern Integrations with Web Services Page 10 i. Call#a#retrieve#object#toreturnall#the#fields#for#personexcept#for#the#audit#

Modern Integrations with Web Services

Page 17

 c. Double  click  on  the  Request  1  for  testing.    

 d. Enter  any  necessary  parameters  and  press  the  green  go  arrow.  

Page 18: CA 2E / CA Plex Conference - …plex2e.com/.../Mark_Schroder-2E_Modernization_Workshop.pdfModern Integrations with Web Services Page 10 i. Call#a#retrieve#object#toreturnall#the#fields#for#personexcept#for#the#audit#

Modern Integrations with Web Services

Page 18

 B. Create  Web  Service  to  Change  values  

 

   

 1. Create  three  basic  functions.  

a. SRV  Get  Person  (USERID)    MOD  b. SRV  Get  Person  (USERID)  PGM  c. SRV  Get  Person  (USERID)    SPS  

Page 19: CA 2E / CA Plex Conference - …plex2e.com/.../Mark_Schroder-2E_Modernization_Workshop.pdfModern Integrations with Web Services Page 10 i. Call#a#retrieve#object#toreturnall#the#fields#for#personexcept#for#the#audit#

Modern Integrations with Web Services

Page 19

d. WS  is  optional  2. Build  the  CTL  –  Same  options  as  in  the  first  web  service.  

a. Set  the  HLL  to  RP4  b. Set  the  Object  Type  to  MOD  

i. To  do  this  enter  a  T  at  ?  and  the  Object  Type  will  change  to  a  module.    c. Check  the  Compile  Overrides  

i. The    Compiler  Overrides  for  the  PGMINFO  parameter  to    PGMINFO(*PCML  *MODULE)  

 3. Build  the  PGM    

a. Set  the  Input  Parameters.  i. Key  –  User  ID  ii. Inputs  –  all  fields  except  audit  stamp  fields.      

b. Optional,  the  target  can  be  RP4,  RPG,  COBOL  or  CBI  c. Add  code  in  the  program  to  change  the  user  information.    

 

   4. Build  the  SPS  

a. Add  the  module  using  the  IBM  Deployed  Services  tool.    b. Z  into  the  function  and  enter  an  M  on  the  option  field.      c. F6  to  select  and  add  the  module  to  the  Service  Program.      

 7. Deploy  the  Web  Service  

a. Open  to  tools  if  it  is  not  open:  http://devi5.cmfirsttech.com:2001/HTTPAdmin  b. Follow  the  sets  in  section  5  above.      

 8. Test  the  web  service  with  SOAPUI.    

 B. Create  a  Web  Services  to  bring  back  a  List  of  Records.    

1. Create  three  basic  functions.  

Page 20: CA 2E / CA Plex Conference - …plex2e.com/.../Mark_Schroder-2E_Modernization_Workshop.pdfModern Integrations with Web Services Page 10 i. Call#a#retrieve#object#toreturnall#the#fields#for#personexcept#for#the#audit#

Modern Integrations with Web Services

Page 20

a. SRV  List  Persons  (USERID)    MOD  b. SRV  List  Persons  (USERID)  PGM  c. SRV  List  Persons  (USERID)    SPS  d. WS  is  optional  e.  

2. Build  the  PGM    a. Set  the  Input  Parameters.  

i. Key  –  User  ID  ii. Inputs  –  all  fields  except  audit  stamp  fields.      

b. Optional,  the  target  can  be  RP4,  RPG,  COBOL  or  CBI    

   

3. Add  code  in  the  program  to  get  a  list  of  user.    a. Initialized  the  Array.    Create  a  loop  that  will  initialize  all  30  elements  of  the  output  

array.    b. Build  the  internal  data  array  by  reading  the  person  table  and  add  each  person  to  the  

array.    c. Build  the  output  array  list.    Read  through  the  data  array  and  add  each  element  to  

the  output  array.        

Page 21: CA 2E / CA Plex Conference - …plex2e.com/.../Mark_Schroder-2E_Modernization_Workshop.pdfModern Integrations with Web Services Page 10 i. Call#a#retrieve#object#toreturnall#the#fields#for#personexcept#for#the#audit#

Modern Integrations with Web Services

Page 21

   

d. In  the  look  write  the  data  to  the  output  array    

   

e. Set  the  return  code  and  exit  the  program.      

4. Build  the  Module  –  Same  options  as  in  the  first  web  service.  a. Set  the  HLL  to  RP4  b. Set  the  Object  Type  to  MOD  

i. To  do  this  enter  a  T  at  ?  and  the  Object  Type  will  change  to  a  module.    c. Check  the  Compile  Overrides  

i. The    Compiler  Overrides  for  the  PGMINFO  parameter  to    PGMINFO(*PCML  *MODULE)  

 d. The  Module  calls  the  PGM.    

Page 22: CA 2E / CA Plex Conference - …plex2e.com/.../Mark_Schroder-2E_Modernization_Workshop.pdfModern Integrations with Web Services Page 10 i. Call#a#retrieve#object#toreturnall#the#fields#for#personexcept#for#the#audit#

Modern Integrations with Web Services

Page 22

5. Build  the  SPS  a. Add  the  module  using  the  IBM  Deployed  Services  tool.    b. Z  into  the  function  and  enter  an  M  on  the  option  field.      c. F6  to  select  and  add  the  module  to  the  Service  Program.      

 9. Deploy  the  Web  Service  

a. Open  to  tools  if  it  is  not  open:  http://devi5.cmfirsttech.com:2001/HTTPAdmin  b. Follow  the  steps  in  the  previous  exercises  to  deploy  the  web  service.    

 10. Test  the  web  service  with  SOAPUI.