Moving a File from One Remote Directory to Another Remote Directory on the Same FTP Server

Oracle JCA Adapter for FilesFTP 4-211

10. Enter a dummy file name, and then click Next. The File Name page is displayed.

11. Click Next. The Messages page is displayed.

12. Select Native format translation is not required Schema is opaque, and then

click Next. The Finish page is displayed. 13. Click Finish. The outbound Oracle File Adapter is now configured. 14. Drag the small triangle in the BPEL process in the Components area to the drop zone that appears as a green triangle in FTPMove in the External References area. The BPEL component is connected to the Oracle FTP Adapter outbound service.

15. Click File, Save All.

16. Create an invoke activity for the FTPMove service that you just created. The next step is to modify the generated WSDL file for FTPMove service and configure it with the new interaction specification for the move operation. 17. Open the FTPMove_ftp.jca file and modify the interaction-spec, as shown in the following example. You must configure the JCA file with the source and target directory and file details. You can either hardcode the source and target directory and file details in the JCA file or use header variables to populate them. In this example, header variables are used. adapter-config name=FTPMove adapter=Ftp Adapter xmlns=http:platform.integration.oracleblocksadapterfwmetadata connection-factory location=eisFtpFtpAdapter adapterRef= endpoint-interaction portType=FTPMove_ptt operation=FTPMove interaction-spec className=oracle.tip.adapter.ftp.outbound.FTPIoInteractionSpec 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 interaction-spec endpoint-interaction adapter-config Note: The dummy file name you enter is not used. You must manually change the file name in a later step. Note: You have modified the className attribute, and added SourcePhysicalDirectory, SourceFileName, TargetPhysicalDirectory, TargetFileName, and Type. Currently, the values for the source and target details are dummy. You must populate them at run-time. You can also hardcode them to specific directories or file names. The Type attributes decides the type of operation. Apart from MOVE, the other acceptable values for the Type attribute are COPY and DELETE. 4-212 Oracle Fusion Middleware Users Guide for Technology Adapters 18. Map the actual directory and file names to the source and target file parameters by performing the following procedure: a. Create 4 string variables with appropriate names. You must populate these variables with the source and target directory details. The BPEL source view shows you this: 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 variables b. Create an assign activity to assign values to sourceDirectory, sourceFileName, targetDirectory, and targetFileName variables. The assign operation appears in the BPEL source view as in the following example: assign name=AssignFTPFileDetails copy from expression=homeftp to variable=sourceDirectory copy copy from expression=input.txt to variable=sourceFileName copy copy from expression=homeftpout to variable=targetDirectory copy copy from expression=output.txt to variable=targetFileName copy assign In the preceding example, input.txt is moved or renamed from homeftp to output.txt in homeftpout. c. Pass these parameters as headers to the invoke operation. The values in these variables override the parameters in the JCA file. invoke name=InvokeRenameService inputVariable=InvokeRenameService_RenameFile_InputVariable partnerLink=RenameFTPFile portType=ns2:RenameFile_ptt operation=RenameFile bpelx:inputProperty name=jca.file.SourceDirectory variable=returnDirectory bpelx:inputProperty name=jca.file.SourceFileName variable=returnFile bpelx:inputProperty name=jca.file.TargetDirectory Note: The source and target details are hardcoded in the preceding example. You can also provide these details as run-time parameters. Oracle JCA Adapter for FilesFTP 4-213 variable=returnDirectory bpelx:inputProperty name=jca.file.TargetFileName variable=targetFile invoke 19. Finally, add an initial receive or pick activity. You have completed moving or renaming a file from a remote directory to another remote directory on the same FTP server. 4.5.11.6 Moving a File from a Local Directory on the File System to a Remote Directory on the FTP Server The steps for this use case are the same as the steps for the use case in Section 4.5.11.5, Moving a File from One Remote Directory to Another Remote Directory on the Same FTP Server except that you must configure the source directory as local and the target directory as remote. Use the SourceIsRemote and TargetIsRemote properties to specify whether the source and target file are on the local or remote file system, as shown in the following example: adapter-config name=FTPMove adapter=Ftp Adapter xmlns=http:platform.integration.oracleblocksadapterfwmetadata connection-factory location=eisFtpFtpAdapter adapterRef= endpoint-interaction portType=FTPMove_ptt operation=FTPMove interaction-spec className=oracle.tip.adapter.ftp.outbound.FTPIoInteractionSpec property name=SourcePhysicalDirectory value=foo1 property name=SourceFileName value=bar1 property name=SourceIsRemote value=false property name=TargetPhysicalDirectory value=foo2 property name=TargetFileName value=bar2 property name=Type value=MOVE interaction-spec endpoint-interaction adapter-config Note: If the FTP server does not support the RNFRRNTO FTP commands, then you must set UseNativeRenameOperation to FALSE and define the property in composite.xml, as shown in the following example: reference name=FTPMove ui:wsdlLocation=FTPMove.wsdl interface.wsdl interface=http:xmlns.oracle.compcbpeladapterftpSOAFtpIOSOAF tpIOFTPMovewsdl.interfaceFTPMove_ptt binding.jca config=FTPMove_ftp.jca property name=UseNativeRenameOperation type=xs:string many=false override=mayfalseproperty binding.jca reference 4-214 Oracle Fusion Middleware Users Guide for Technology Adapters 4.5.11.7 Moving a File from a Remote Directory on the FTP Server to a Local Directory on the File System The steps for this use case are the same as the steps for the use case in Section 4.5.11.6, Moving a File from a Local Directory on the File System to a Remote Directory on the FTP Server except that you must configure the source directory as remote and the target directory as local, as shown in the following example: adapter-config name=FTPMove adapter=Ftp Adapter xmlns=http:platform.integration.oracleblocksadapterfwmetadata connection-factory location=eisFtpFtpAdapter adapterRef= endpoint-interaction portType=FTPMove_ptt operation=FTPMove interaction-spec className=oracle.tip.adapter.ftp.outbound.FTPIoInteractionSpec property name=SourcePhysicalDirectory value=foo1 property name=SourceFileName value=bar1 property name=TargetPhysicalDirectory value=foo2 property name=TargetFileName value=bar2 property name=TargetIsRemote value=false property name=Type value=MOVE interaction-spec endpoint-interaction adapter-config

4.5.11.8 Moving a File from One FTP Server to another FTP Server

To move a file from one FTP server to another FTP server you must sequentially perform the use cases documented in the following sections: 1. Section 4.5.11.7, Moving a File from a Remote Directory on the FTP Server to a Local Directory on the File System to upload the file from the local directory to another FTP server 2. Section 4.5.11.6, Moving a File from a Local Directory on the File System to a Remote Directory on the FTP Server to download the file from the FTP server to a local directory Note: In this example, you have configured SourceIsRemote as false. In this case, the FTP input and output operation assumes that the source file comes from a local file system. Also, notice that you did not specify the parameter for target because TargetIsRemote is set to true by default. Note: In this example, you have configured TargetIsRemote as false. In this case, the FTP IO assumes that the source file comes from a remote file system whereas the target is on a local file system. Also, notice that you did not specify the parameter for source because SourceIsRemote is set to true by default. 5 Oracle JCA Adapter for Sockets 5-1 5 Oracle JCA Adapter for Sockets This chapter describes how to use Oracle JCA Adapter for Sockets Oracle Socket Adapter, which works with Oracle BPEL Process Manager Oracle BPEL PM and Oracle Mediator Mediator as an external service. This chapter includes the following sections: ■ Section 5.1, Introduction to Oracle Socket Adapter ■ Section 5.2, Oracle Socket Adapter Features ■ Section 5.3, Oracle Socket Adapter Concepts ■ Section 5.4, Configuring Oracle Socket Adapter ■ Section 5.5, Oracle Socket Adapter Use Cases

5.1 Introduction to Oracle Socket Adapter

Oracle Socket Adapter is a JCA 1.5 compliant adapter for modeling standard or nonstandard protocols for communication over TCPIP sockets. You can use an Oracle Socket Adapter to create a client or a server socket, and establish a connection. The data that is transported can be text or binary. This section includes the following topics: ■ Section 5.1.1, Oracle Socket Adapter Architecture ■ Section 5.1.2, Oracle Socket Adapter Integration with Mediator ■ Section 5.1.3, Oracle Socket Adapter Integration with Oracle BPEL PM ■ Section 5.1.4, Oracle Socket Adapter Integration with SOA Composite

5.1.1 Oracle Socket Adapter Architecture

Oracle Socket Adapter is based on the JCA 1.5 architecture. JCA provides a standard architecture for integrating heterogeneous enterprise information systems EIS. The JCA Binding Component of the Oracle Socket Adapter exposes the underlying JCA interactions as services WSDL with JCA binding for Oracle BPEL PM integration. Figure 5–1 illustrates the architecture of Oracle Socket Adapter. For details about the Oracle JCA Adapter architecture, see Section 1.2.1.1, Architecture.