Saturday, October 22, 2011

Oracle SOA Dynamically set JCA properties for File Move/Delete/Copy service.

Oracle SOA 11.1.1.5 Dynamically set JCA properties for File Move/Delete/Copy service.

This thread discusses how to dynamically set JCA properties for File Move/Delete/Copy service. The service can then be used to MOVE, DELETE or COPY a file.

  • Create a BPEL process.
  • In the right Swim Lane (External  References Swim Lane) configure a File Services Adapter.
  • Select Define from operation and schema (specified later), and click Next. The Operation page is displayed.
  • Select Synchronous Read File, enter FileMove in the Operation Name field, and then click Next. The File Directories page is displayed.
  • Alter the properties in the JCA file as follows

    <property name="SourcePhysicalDirectory" value="foo1"/>
     <property name="SourceFileName" value="bar1"/>
     <property name="TargetPhysicalDirectory" value="foo2"/>
     <property name="TargetFileName" value="bar2"/>
     <property name="Type" value="MOVE"/>

     
  • In the BPEL processa add the following variables.
<variable name="InvokeMoveOperation_FileMove_InputVariable" 
messageType="ns1:Empty_msg"/>
    <variable name="InvokeMoveOperation_FileMove_OutputVariable"
messageType="ns1:FileMove_msg"/>
    <variable name="sourceDirectory" type="xsd:string"/>
    <variable name="sourceFileName" type="xsd:string"/>
    <variable name="targetDirectory" type="xsd:string"/>
    <variable name="targetFileName" type="xsd:string"/>

  • Create an Invoke activity for the JCA adapter.
<bpelx:inputProperty name="jca.file.SourceDirectory" 
variable="sourceDirectory"/>
      <bpelx:inputProperty name="jca.file.SourceFileName" 
variable="sourceFileName"/>
      <bpelx:inputProperty name="jca.file.TargetDirectory" 
variable="targetDirectory"/>
      <bpelx:inputProperty name="jca.file.TargetFileName" 
variable="targetFileName"/>


  • Create an Assign activity and copy the variables. 
<copy>
        <from expression="'/tmp/src'"/>
        <to variable="sourceDirectory"/>
      </copy>
      <copy>
        <from expression="'input1.txt'"/>
        <to variable="sourceFileName"/>
      </copy>
      <copy>
        <from expression="'/tmp/output'"/>
        <to variable="targetDirectory"/>
      </copy>
      <copy>
        <from expression="'output.txt'"/>
        <to variable="targetFileName"/>
      </copy>


  • Deploy the service to test it. 
For questions, comments and feedback  please contact:
 Harvinder Singh Saluja

    Wednesday, October 12, 2011

    OWSM policies to access secured web services from Oracle SOA

    Oracle Fusion Middleware 11g Release 1 (10.3.x) products install a portability layer on top of
    WebLogic Server that integrates Oracle Web Services Manager WS-Security policies into the WebLogic Server environment. This portability layer provides Oracle WSM WS-Security policies that  can be used to protect WebLogic Server JAX-WS Web services and Web service clients.
    • If you develop WebLogic Server JAX-WS Web services or clients that interact with SOA Composite Services, ADF Components, or WebCenter Services, then you should use the Oracle WSM WS-Security policies.
    • If you develop only WebLogic Server native Java JAX-WS Web services, then you should use WebLogic Server's WS-Security policies.

    HTTP Basic authentication for composites calling secured services

    • Setup username and password on SOA

      • Weblogic Domain-->Base Domain--> Security-->Credentials 

    • Create a map oracle.wsm.security

      •  Create key; basic.credentials and csf-key 




    Modify composites calling secured services

    • Right click on the web services adapter in the composite and add the security policy


    To use a custom key instead of csf-key, create a key test-key using enterprise manager










    Change the composite and override the default key



    For questions, comments and feedback  please contact:
     Harvinder Singh Saluja


    OCI Knowledge Series: OCI Infrastructure components

      Oracle Cloud Infrastructure (OCI) provides a comprehensive set of infrastructure services that enable you to build and run a wide range of...